Game Maker help: Creating menu for bullet hell game

A place for people with an interest in developing new shmups.
Post Reply
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

( Please, if i posted this in the wrong area, please let me know. I've looked in each catagory, but i dont know which one is useful for asking help, so i choose the Development thread. )

Hello, and sorry to bother everyone with a sudden and short appearance, but i need a bit of help with anyone that used game maker before.

For my portfolio class assignment at ITT, i'm currently making a demo of a top down bullet hell shoot game called Bullet Spike, a top down shooter inspired by Geist's "My Little Pegasus: DoPonyPachi" game (Please save the groans and moans against MLP for later). However this is my first time using Game Maker, and my very first game, so i have run into a few issue, one that is most currently bothering me is creating the start menu.

You see, i have a monitor resolution of 1920 x 1080, and i thought i could make a game as such a resolution. I have already designed sprites and story to fit that size, and have character art drawn for me by a very close friend of mine <3.

When i play the game at my normal resolution, the menu is reacting normally, with the mouse hovering over each icon making it glow. http://i.imgur.com/H0xbeEc.jpg (Screenshots dont allow the cursor to be seen)

However, i tested this on smaller resolutions by changing my screen resolution size before starting the game. The result is that the menu text cant be highlighted unless the mouse is away from the text, way off from where the mouse is supposed to hoover over it. http://i.imgur.com/L4po5rZ.jpg (Screenshots dont allow the cursor to be seen)

I wouldnt mind having the player navigate the menu with the ASWD keys or Arrow keys, but i dont know how to do that, so I'm stuck with navigation through mouse. I've been looking through youtube, but no tutorials on navigation by keyboard yet.

My Question: Is there a way to have the game scale in size to fit a players smaller screen, so that no matter the resolution of other players, the menu can be navigated accordingly?

To test my example, here is the link to the problem in this WIP game https://www.dropbox.com/s/c2uwy66jtt96fdp/WIP.exe

And a link to the Game Maker file (unknown if it'll have sound) https://www.dropbox.com/s/ldlsih6vkwkl6rh/WIP.gmk

Thank you in advance for your help^^
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
Giest118
Posts: 1042
Joined: Wed May 02, 2012 1:50 am

Re: Game Maker help: Creating menu for bullet hell game

Post by Giest118 »

Oh, wow... dear god, is Game Maker actually this dumb? Lower resolution causes the mouse to die horribly? Okay Game Maker. I'll play.

I created an alternative (but equivalent) method of getting the game to detect mouse movement by way of some GML. Specifically I used this code in the Step event for one of the menu buttons.

Code: Select all

mousex=mouse_x*room_width/display_get_width();
mousey=mouse_y*room_height/display_get_height();

if((mousex > x) && (mousex < x+405) && (mousey > y) && (mousey < y+82))
{
    if(MouseIn < 0)
    {
        //Mouse enters button area
        sound_play(snd_select);
        sprite_index=spr_ng_highlight;
    }
    MouseIn=2;
} else {
    if(MouseIn > 0)
    {
        //Mouse exits button area
        sprite_index=spr_ng_unpress;
    }
}

MouseIn-=1;
Basically this code converts the mouse coordinates into the scale of the monitor you're running the game on. It then sees if the mouse is within a certain x-y range. Then it does some vaguely confusing logic to decide whether to switch the button graphics.

Note that there is a chance that this code will crash and die a horrible death if the player decides to run your game in Windowed mode. I cannot test this because I do not have a sufficiently high-resolution screen.

A more long-term (and stable) solution would probably be to use a lower game resolution... or use keyboard input instead of mouse input.

Modified WIP file: https://dl.dropboxusercontent.com/u/289 ... n/WIP2.gmk
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Hehe, wow! My first reply and it's from Giest! Yay XP

But judging from what you've said and a few tests at different resolutions, i agree with you and will take your advice that navigation through keyboard would be easier, though something i never tried. Now, how to do that...

Should i make a variable that determines which button to highlight and select?

Like, my plan is to make a Variable called Keynumber.

New Game has the Keynumber variable of 1
Load Game has 2
Options has 3
Exit has 4

The game opens with New Game already highlighted, and the Keynumber Variable is 1. If the player presses "S" or the down key, the variable becomes 2, making Load Game become highlighted. If instead "W" or the up key was press, the variable becomes 4, and exit is highlighted. Up from Exit becomes 3, and so forth.

Or maybe there is an easier way to make navigation by key, like you did in your game?
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Game Maker help: Creating menu for bullet hell game

Post by BPzeBanshee »

You're on the right idea but make the values relative. For instance you could do:

Code: Select all

// moving up
if keyboard_check_pressed(vk_up) && keynumber > 1
{
keynumber -= 1;
}

// moving down
if keyboard_check_pressed(vk_down) && keynumber < 4
{
keynumber += 1;
}

if keyboard_check_pressed(ord("Z"))
{
if keynumber = 1
    {
     // first option
    }
// etc
}

// Highlight code
if keynumber = 1
{
// whatever you're doing to make highlight over the text (sorry for not being precise, I'm on a Mac atm)
}
// etc
That's more or less the idea behind how GMOSSE's menu systems work. I admit it's probably not the *most* friendly to look at but it's very versatile and requires little effort to modify to make it have four, five or any amount of options in the menu.

As for the mouse, I didn't know it did any of that shit. Making a game in GM in 1920x1080 is a *very* bad idea anyway, but since you're far enough ahead that it can't really be changed either Giest's trick with mouse handling or in-game modifications of window size I think should do the trick.
User avatar
Giest118
Posts: 1042
Joined: Wed May 02, 2012 1:50 am

Re: Game Maker help: Creating menu for bullet hell game

Post by Giest118 »

What I did in My Little Pegasus (and all of my games really) was have a separate MenuController object that keeps track of keyboard inputs. In the Step event of each of the menu button objects I had a check that sees whether MenuController.Select is equal to a certain number (say, 1 for the new game button). If it is, highlight the button. Otherwise, unhighlight. Pressing Enter does a different thing depending on what Select is equal to.

Should be pretty easy to do. :V
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Alrighty! I cant wait to try out both ways! Thank you so much for your help, guys! Hopefully i can make you guys proud when my demo is done. It wont be the HARDEST game, but I'm sure there is something about it that will separate it from the everyday shooter.
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Game Maker help: Creating menu for bullet hell game

Post by n0rtygames »

I have no idea about game maker, but just do something like this.

CODE IS NOT PROVIDED WITH SUPPORT, WARRANTY OR ANYTHING NICE.
rikkusguardian wrote:I wouldnt mind having the player navigate the menu with the ASWD keys or Arrow keys, but i dont know how to do that

Code: Select all

int mnSelectedMenu = 0;
int mnMaxMenu = 10;

string[] labels = new string{"menu1", "menu2", "menu3", "menu4", "menu5", "menu6", "menu7", "menu8", "menu9", "menu10"};

void Update()
{
    if (input.up) mnSelectedMenu--;
    if (input.down) mnSelectedMenu++;

    if (mnSelectedMenu < 0) mnSelectedMenu = mnMaxMenu - 1;
    if (mnSelectedMenu >= mnMaxMenu) mnSelectedMenu = 0;

    if (input.a) processMenu(mnSelectedMenu);


}

void processMenu(int val)
{
    switch (val)
    {
       case 0: dosomething(); break;
       case 1: dosomethingelse(); break;
       case 2: dosomethingevendifferent(); break;
etcetc
    }
}

void RenderStuff()
{
    int x = 32;
    int y = 32;
    for (i = 0; i < mnMaxMenu; i++)
    {
        if (mnSelectedMenu == i)
              DrawString(labels[i],x,y,RED);
        else
              DrawString(labels[i],x,y,WHITE);
    }
}
You now have menus.
Last edited by n0rtygames on Sat Apr 13, 2013 6:55 pm, edited 1 time in total.
facebook: Facebook
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Wow...really, guys, thank yo so very much for everything! <3 I was originally intimated to come to this site because i didn't want to sound like an annoying noobie beggar always making help post (How do you make menus? How do i shoot bullets rapidly? How can enemies shoot ME? How can i make bullet patterns? ect, ect), but you guys are so helping and friendly! I promise i'll make it up to you guys somehow, that's for sure! This forum rocks!

But....i probably will ask those very questions in a moment in later posts. (Except for the rapid shooting, i was able to find a tut on youtube^^)
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: Game Maker help: Creating menu for bullet hell game

Post by trap15 »

Here's how I handle menus in the Test Menu for my game:

Code: Select all

        .text
###########################################################
testmode_perframe:
###########################################################
        MOVEM.L D0-D4/A0-A2, -(SP)

        MOVEQ   #0, D4
        MOVE.B  (_cur_menu_idx), D4
        MOVEA.L (_cur_menu_ptr), A2
        MOVE.W  (A2), D3

        BTST.B  #1, testobj__flags(A0)
        BEQ     3f
        BCLR.B  #1, testobj__flags(A0)

        MOVEA.L 2(A2), A3
        JSR     (A3)

        BCLR.B  #2, testobj__flags(A0)

        MOVE.L  A0, -(SP)
        LEA.L   6(A2), A0
        MOVEQ.L #16, D0
        MOVEQ.L #1, D1
        BSR     text_printstr
        MOVE.L  (SP)+, A0

        SUBI.W  #1, D3
        BCS     4f

        MOVE.L  A0, -(SP)
        LEA.L   22(A2), A0
        ADDQ.L  #4, D4
        MOVEQ.L #4, D1
1:
        MOVEQ.L #4, D0

        MOVE.L  A0, -(SP)
        LEA.L   (_asterisk), A0
        CMP.W   D4, D1
        BEQ     2f
        ADDA.W  #2, A0
2:
        BSR     text_printstr
        MOVE.L  (SP)+, A0

        ADDQ.W  #2, D0
        BSR     text_printstr
        ADDQ.L  #1, D1
        ADDA.W  #0x18, A0
        DBRA    D3, 1b

        SUBQ.L  #2, D4
        MOVE.W  (A2), D3
        MOVE.B  (_cur_menu_idx), D4
        MOVE.L  (SP)+, A0

3:
        SUBI.W  #1, D3
        BCS     4f

        LEA.L   22(A2), A2

        MOVEA.L testobj__input1P(A0), A1
        MOVE.B  inp__down(A1), D1
        MOVEA.L testobj__input2P(A0), A1
        MOVE.B  inp__down(A1), D2
        OR.B    D2, D1

        BTST    #0, D1
        BEQ     1f
        # Up
        BSR     _test_up
1:
        BTST    #1, D1
        BEQ     1f
        # Down
        BSR     _test_down
1:
        BTST    #2, D1
        BEQ     1f
        # Left
        BSR     _test_left
1:
        BTST    #3, D1
        BEQ     1f
        # Right
        BSR     _test_right
1:
        BTST    #4, D1
        BEQ     1f
        # BtnA
        BSR     _test_right
        BRA     4f
1:
        BTST    #5, D1
        BEQ     4f
        # BtnB
        BSR     _test_left
4:
        MOVE.B  D4, (_cur_menu_idx)

        MOVEM.L (SP)+, D0-D4/A0-A2
        RTS

_test_left:
        BSET.B  #1, testobj__flags(A0)

        MOVEQ   #0, D0
        MOVE.B  D4, D0
        MOVE.B  D4, D2
        LSL.B   #4, D0
        LSL.B   #3, D2
        ADD.B   D2, D0
        MOVEA.L 20(A2,D0.W), A2
        CMPA.L  #0, A2
        BEQ     1f
        JSR     (A2)
1:
        RTS

_test_right:
        BSET.B  #1, testobj__flags(A0)

        MOVEQ   #0, D0
        MOVE.B  D4, D0
        MOVE.B  D4, D2
        LSL.B   #4, D0
        LSL.B   #3, D2
        ADD.B   D2, D0
        MOVEA.L 16(A2,D0.W), A2
        CMPA.L  #0, A2
        BEQ     1f
        JSR     (A2)
1:
        RTS

_test_up:
        BSET.B  #1, testobj__flags(A0)

        CMPI.B  #0, D4
        BNE     1f
        MOVE.B  D3, D4
        RTS
1:
        SUBQ.B  #1, D4

        MOVEQ   #0, D0
        MOVE.B  D4, D0
        MOVE.B  D4, D2
        LSL.B   #4, D0
        LSL.B   #3, D2
        ADD.B   D2, D0
        TST.L   16(A2,D0.W)
        BNE     1f
        TST.L   20(A2,D0.W)
        BNE     1f
        BRA     _test_up
1:
        RTS

_test_down:
        BSET.B  #1, testobj__flags(A0)

        CMP.B   D3, D4
        BNE     1f
        MOVE.B  #0, D4
        RTS
1:
        ADDQ.B  #1, D4

        MOVEQ   #0, D0
        MOVE.B  D4, D0
        MOVE.B  D4, D2
        LSL.B   #4, D0
        LSL.B   #3, D2
        ADD.B   D2, D0
        TST.L   16(A2,D0.W)
        BNE     1f
        TST.L   20(A2,D0.W)
        BNE     1f
        BRA     _test_down
1:
        RTS

_test_exit:
_test_gamemode:
        BCLR.B  #objflag__alive, obj__flags(A0)
        RTS

_test_softdip:
        BSET.B  #2, testobj__flags(A0)
        MOVE.L  #_testmenu_softdip, (_cur_menu_ptr)
        MOVEQ   #0, D4
        BSR     text_clear
        RTS

_test_exit_main:
        BSET.B  #2, testobj__flags(A0)
        MOVE.L  #_testmenu_main, (_cur_menu_ptr)
        MOVEQ   #0, D4
        BSR     text_clear
        RTS

###########################################################
_testmenu_main_update:
###########################################################
        MOVEM.L D0-D1/A0, -(SP)
        LEA.L   (_testmenustr_updown_a), A0
        MOVEQ.L #0, D0
        MOVEQ.L #26, D1
        BSR     text_printstr
        MOVEM.L (SP)+, D0-D1/A0
        RTS

###########################################################
_testmenu_softdip_update:
###########################################################
        MOVEM.L D0-D1/A0, -(SP)
        LEA.L   (_testmenustr_updown_leftright), A0
        MOVEQ.L #0, D0
        MOVEQ.L #26, D1
        BSR     text_printstr
        LEA.L   (_testmenustr_updown_leftright2), A0
        MOVEQ.L #25, D1
        BSR     text_printstr

        LEA.L   (_testmenustr_dip_5space), A0
        MOVE.W  (conf_lives), D0
        LSL.W   #2, D0
        MOVEA.L (A0,D0.W), A0
        MOVEQ.L #24, D0
        MOVEQ.L #4, D1
        BSR     text_printstr

        LEA.L   (_testmenustr_dip_5space), A0
        MOVE.W  (conf_maxlives), D0
        LSL.W   #2, D0
        MOVEA.L (A0,D0.W), A0
        MOVEQ.L #24, D0
        MOVEQ.L #5, D1
        BSR     text_printstr

        LEA.L   (_testmenustr_dip_rank), A0
        MOVE.W  (conf_rank), D0
        LSL.W   #2, D0
        MOVEA.L (A0,D0.W), A0
        MOVEQ.L #24, D0
        MOVEQ.L #6, D1
        BSR     text_printstr

        LEA.L   (_testmenustr_dip_extend), A0
        MOVE.W  (conf_extend), D0
        LSL.W   #2, D0
        MOVEA.L (A0,D0.W), A0
        MOVEQ.L #24, D0
        MOVEQ.L #7, D1
        BSR     text_printstr

        MOVEM.L (SP)+, D0-D1/A0
        RTS

_test_dip_lives_inc:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_lives), D0
        CMPI.W  #4, D0
        BEQ     1f
        CMP.W   (conf_maxlives), D0
        BEQ     1f
        ADD.W   #1, D0
1:
        MOVE.W  D0, (conf_lives)
        MOVE.W  (SP)+, D0
        RTS
_test_dip_lives_dec:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_lives), D0
        CMPI.W  #0, D0
        BEQ     1f
        SUB.W   #1, D0
1:
        MOVE.W  D0, (conf_lives)
        MOVE.W  (SP)+, D0
        RTS

_test_dip_maxlives_inc:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_maxlives), D0
        CMPI.W  #4, D0
        BEQ     1f
        ADD.W   #1, D0
1:
        MOVE.W  D0, (conf_maxlives)
        MOVE.W  (SP)+, D0
        RTS
_test_dip_maxlives_dec:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_maxlives), D0
        CMPI.W  #0, D0
        BEQ     1f
        CMP.W   (conf_lives), D0
        BEQ     1f
        SUB.W   #1, D0
1:
        MOVE.W  D0, (conf_maxlives)
        MOVE.W  (SP)+, D0
        RTS

_test_dip_rank_inc:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_rank), D0
        CMPI.W  #2, D0
        BEQ     1f
        ADD.W   #1, D0
1:
        MOVE.W  D0, (conf_rank)
        MOVE.W  (SP)+, D0
        RTS
_test_dip_rank_dec:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_rank), D0
        CMPI.W  #0, D0
        BEQ     1f
        SUB.W   #1, D0
1:
        MOVE.W  D0, (conf_rank)
        MOVE.W  (SP)+, D0
        RTS

_test_dip_extend_inc:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_extend), D0
        CMPI.W  #3, D0
        BEQ     1f
        ADD.W   #1, D0
1:
        MOVE.W  D0, (conf_extend)
        MOVE.W  (SP)+, D0
        RTS
_test_dip_extend_dec:
        MOVE.W  D0, -(SP)
        MOVE.W  (conf_extend), D0
        CMPI.W  #0, D0
        BEQ     1f
        SUB.W   #1, D0
1:
        MOVE.W  D0, (conf_extend)
        MOVE.W  (SP)+, D0
        RTS

_test_dip_reset:
        BSR     conf_reset
        RTS

        .data
_testmenustr_dip_5space:
        .long   _testmenustr_dip_5space_0
        .long   _testmenustr_dip_5space_1
        .long   _testmenustr_dip_5space_2
        .long   _testmenustr_dip_5space_3
        .long   _testmenustr_dip_5space_4
_testmenustr_dip_5space_0:
        .asciz  "LOW  (1----) HIGH"
_testmenustr_dip_5space_1:
        .asciz  "LOW  (-2---) HIGH"
_testmenustr_dip_5space_2:
        .asciz  "LOW  (--3--) HIGH"
_testmenustr_dip_5space_3:
        .asciz  "LOW  (---4-) HIGH"
_testmenustr_dip_5space_4:
        .asciz  "LOW  (----5) HIGH"

        .even
_testmenustr_dip_rank:
        .long   _testmenustr_dip_rank_0
        .long   _testmenustr_dip_rank_1
        .long   _testmenustr_dip_rank_2
_testmenustr_dip_rank_0:
        .asciz  "EASY (0--)   HARD"
_testmenustr_dip_rank_1:
        .asciz  "EASY (-1-)   HARD"
_testmenustr_dip_rank_2:
        .asciz  "EASY (--2)   HARD"

        .even
_testmenustr_dip_extend:
        .long   _testmenustr_dip_extend0
        .long   _testmenustr_dip_extend1
        .long   _testmenustr_dip_extend2
        .long   _testmenustr_dip_extend3
_testmenustr_dip_extend0:
        .asciz  "EVERY 10,000"
_testmenustr_dip_extend1:
        .asciz  "EVERY 20,000"
_testmenustr_dip_extend2:
        .asciz  "EVERY 40,000"
_testmenustr_dip_extend3:
        .asciz  "NEVER       "
_testmenustr_updown_a:
        .asciz  "             CHOOSE: \x1E\x1F  SELECT: A              "
_testmenustr_updown_leftright:
        .asciz  "             CHOOSE: \x1E\x1F  CHANGE: \x1C\x1D             "
_testmenustr_updown_leftright2:
        .asciz  "                                 BA             "

_testmenu_main:
        .word   4
        .long   _testmenu_main_update
        .asciz  "   TEST MODE   "

        .asciz  "1. GAME MODE   "
        .long   _test_gamemode, 0
        .asciz  "2. SOFT DIP    "
        .long   _test_softdip, 0
        .asciz  "               "
        .long   0, 0
        .asciz  "3. EXIT        "
        .long   _test_exit, _test_exit

_testmenu_softdip:
        .word   7
        .long   _testmenu_softdip_update
        .asciz  "   SOFT DIP    "

        .asciz  "1. LIVES       "
        .long   _test_dip_lives_inc, _test_dip_lives_dec
        .asciz  "2. MAX LIVES   "
        .long   _test_dip_maxlives_inc, _test_dip_maxlives_dec
        .asciz  "3. DIFFICULTY  "
        .long   _test_dip_rank_inc, _test_dip_rank_dec
        .asciz  "4. EXTENDS     "
        .long   _test_dip_extend_inc, _test_dip_extend_dec
        .asciz  "               "
        .long   0, 0
        .asciz  "5. RESET       "
        .long   _test_dip_reset, 0
        .asciz  "6. EXIT        "
        .long   _test_exit_main, 0

        .bss
_cur_menu_ptr:
        .space  4
_cur_menu_idx:
        .space  1
        .even
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Holy zen, that's a loooooooong code, Trap! :O (Then again i'm still learning code, so maybe that's actually quite normal)

Is there a place where i can look at references of different codes so i can study what each specific command means (Like MOVEQ, int mnSelectedMenu, and so on) ? I mean, i would love to just copy and paste these...(er...where would i paste these? Draw event or Create event, then Execute Code?) and -wam- case solved, but i don't want to seem cheap, like I'm just using you guys. I want to learn from all the help you guys are giving to read and understand what each code means, that way i can return the favor when you guys might need help with something. And that way i wont have to keep bothering ya'll with "what's this code mean? What's that code mean? XP

I already found a good reference of what each drag and drop does <3 http://gamemaker.wikia.com/wiki/List_of_actions
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: Game Maker help: Creating menu for bullet hell game

Post by trap15 »

That wasn't gamemaker, that was 68000 assembly.
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Game Maker help: Creating menu for bullet hell game

Post by n0rtygames »

rikkusguardian wrote:Wow...really, guys, thank yo so very much for everything! <3
You're welcome.

Listen, don't worry about coming across as a newbie. Everyone starts somewhere and to be honest the hardest thing is getting started or finding appropriate and useful answers. You might find some people roll their eyes at some questions -- but if anyone comes down on you for simply asking questions and it's clear you've been trying to find the answers -- tell them to go screw themselves. I hate that sort of mindset, personally.

So long as you're trying to find answers yourself initially, people will be genuinely helpful.

My code was more pseudo code with bits of c and c# -- I can't speak authoratively on Game Maker, I can only suggest things that should be transferable to any language under the sun. The logic is the thing you should focus on - not the actual code itself.

That's the important part of learning to code, not so much understanding the syntax or the language itself - but rather being able to visualise and break down the logic of what you want to achieve. If you can put your problem in to english and you can put the ANSWER in to english - you're already coding. The next leap is translating from friendly english instructions in to the instructions the machine understands.

For instance
"I want to track what menu option is selected" becomes "int selected = 0"
"I want to go to the next option when down is pressed" becomes "if (input.down) selected++;"

A better way to phrase the second one is to start thinking in terms of "if this happens, then do this.. OTHERWISE.. if this happens.. do this... if none of the above? do this" - that becomes:

if (foo) then dosomething
else if (bar) then dosomethingelse
else dosomethingdifferent

see? Just visualise and understand the problems you are trying to solve and you can write anything :)
facebook: Facebook
User avatar
nasty_wolverine
Posts: 1371
Joined: Sun Oct 09, 2011 11:44 pm

Re: Game Maker help: Creating menu for bullet hell game

Post by nasty_wolverine »

trap15 wrote:That wasn't gamemaker, that was 68000 assembly.
you should have just thrown in machine code... for extra lulz :mrgreen:

Just to summarize what everyone else said:

lets say there are five menu items, i ll put down some psuedo C++ code with some comments to make it easier

Code: Select all

int CurrentMenuSelection = 1; // this is the var that keeps track of current selection, initialized to first entry
if(input.up) //if up is pressed 
{
         CurrentMenuSelection--;//decrease current selection
}
if(input.down) //if down is pressed 
{
         CurrentMenuSelection++; //increase current selection
}
utility.clamp(CurrentMenuSelection, 1, 5); //clamp selection to min and max selectable items
renderer.gui.highlight(CurrentMenuSelection); //highligth selected item
if(input.shot) //if shot is pressed
{
         game.loaditem(CurrentMenuSelection); //load current selected item
}
post anything on the dev sub-forum, and someone will surely help you out, or provide assembly code....
Elysian Door - Naraka (my WIP PC STG) in development hell for the moment
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Taking into from what i've learned from all of you, I attempted to make my code using If statements I was able to change the variable using the up and down keyboard press! <3 This is SO much better than the mouse!

However, i stumbled onto another problem.

Combining Geist and N0rty's advice, i made an object called menu control. Since i was not too confident with coding yet, i did the up press in drag and drop, and...

well...i messed up so badly, that i dont even know what i'm doing anymore.

Does anyone happen to have Skype? I was hoping to share screens, so i can show what i'm doing wrong, because this is becoming too much.

my skype is rikkusguardian
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
Giest118
Posts: 1042
Joined: Wed May 02, 2012 1:50 am

Re: Game Maker help: Creating menu for bullet hell game

Post by Giest118 »

I have Skype. My handle is exactly what you think it is. Add me so we can do the messagery.
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

RE: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Yes! After a LOT of 1 on 1 help with Geist, i was able to get the menu of the game working perfectly!

Gone is the crazy mouse problem (I like using the keyboard better), you can now navigate using either the UP, DOWN, "S" or "W" keys however you wish.

https://www.dropbox.com/s/sn0xen93aogqr19/Menu.exe

As thanks, i'm going to make a detailed explanation on how this menu is functional, using the advice i learned from all of you that helped me, that way no other novice like me should have this problem. (However, this will all involve Drag and Drop, so i'm sorry, GML lovers. I'm not ready for the complicated stuff yet.) <3

Just give me some time to develop all the screenshots and details (most likely after my course is over and i presented the full game). Thank you all so much! This is a huge relief for me <3
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Game Maker help: Creating menu for bullet hell game

Post by BPzeBanshee »

trap15 wrote:<almost completely irrelevant and generally unhelpful assembly code>
Image

Glad you got your menu fixed rikkusguardian. I'm interested to see where the game leads, even if I can't run it on most machines I own thanks to the 1920x1080 requirement.
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

BPzeBanshee wrote:
trap15 wrote:<almost completely irrelevant and generally unhelpful assembly code>
Image

Glad you got your menu fixed rikkusguardian. I'm interested to see where the game leads, even if I can't run it on most machines I own thanks to the 1920x1080 requirement.
Aw, so Trap was just pulling mah' leg? XP

And thank you very much! I'll try to do my best on it, and i'll see if I can do a smaller 16:9 ratio after my presentation of the demo at class. Does 1280x800 sound good? Or maybe even 1600x900? (Oh, then again, i could always make different resolution versions of the game, if that can help <3)
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Game Maker help: Creating menu for bullet hell game

Post by BPzeBanshee »

Well, 68000 assembly code isn't helpful or relevant to a thread about GM, but I'm sure that's plain obvious already.

With game window size, generally for best results regarding performance I'd be going real low and then scale up - like original arcade games. My own project runs in 240x320. Some fetishists don't like the blur (I do: and it's not GM-specific anyway) which can be ratified with a few tricks, but that's for when you're solidly in GML and I wouldn't be too concerned with it.

Other projects like Giest's one run in a higher res like 800x600, and is a rare example of a GM shmup that's high-res and not complete crap: avoid using a high res for your next game. You can scale up or bump up the window size later down the track of the project if need be, but it isn't as easy to do so in reverse as you've learnt the hard way.
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: Game Maker help: Creating menu for bullet hell game

Post by trap15 »

It's helpful for demonstrating that the same basic principle underlies all menu systems :wink:
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

trap15: Oh, I understand, Trap!^^ No problem. <3 Maybe once i get better and understand coding, i can look back at this and go "Oooooh! So that's what he was showing me! Duh XP"

Banshee: And got it, i'll make sure to do that for my later projects. Now, what if i'm doing a game that has going to have character images and story text, like Bullet Spike will? http://pinoytutorial.com/techtorial/wp- ... -story.jpg http://www.japanator.com/elephant/ul/23013-620x-P4a.jpg Can i try a hi-res like Giest's?
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Game Maker help: Creating menu for bullet hell game

Post by BPzeBanshee »

You don't need to do hi-res to do text. Deathsmiles does text fine and that's a game in 320x240. My own project has a dialog test that works fine too. The trick is small text font size.
User avatar
mice
Posts: 829
Joined: Tue Apr 26, 2005 2:50 pm
Location: Sweden
Contact:

Re: Game Maker help: Creating menu for bullet hell game

Post by mice »

Make sure you can edit/change the contents of the menu and create new menues easy.

Here's more unuseful code for you:

Code: Select all

	<focusgroup name="title_screen" capacity="6" forward="DOWN" backward="UP" wrap="false" change_sound="sounds/soft_clinc.wav" select_sound="sounds/ping.wav"/>

	<window name="title_screen" x="0" y="0" w="352" h="192" background="">
		<button label="${start}" group="title_screen" centered_x="true" x="0" y="120" w="40" h="8" action="ACTION:character_select" font="font.png" />
		<button label="${screen}" group="title_screen" centered_x="true" x="0" y="130" w="56" h="8" action="WINDOW:screen_size" font="font.png" />
		<button label="${controls}" group="title_screen" centered_x="true" x="0" y="140" w="56" h="8" action="WINDOW:controller_at_main_menu" font="font.png" />
		<button label="${hiscores}" group="title_screen" centered_x="true" x="0" y="150" w="56" h="8" action="WINDOW:hiscore_list" font="font.png" />
		<button label="${about}" group="title_screen" centered_x="true" x="0" y="160" w="56" h="8" action="WINDOW:about" font="font.png" />
		<button label="${exit}" group="title_screen" centered_x="true" x="0" y="170" w="32" h="8" action="WINDOW:really_quit" font="font.png" />
		<animation source="title_title.p2d" x="176" y="130" /> 
	</window>
User avatar
rikkusguardian
Posts: 16
Joined: Thu Mar 21, 2013 9:01 am

Re: Game Maker help: Creating menu for bullet hell game

Post by rikkusguardian »

Got it! I'll keep that in mind, Mice and Banshee!^^

I'm actually about to try to make scrolling text now! <3
Well, I learned my lesson from this site. But at least I now have inspiration from Cagar and Roo on making comedy relief sub-bosses...
Post Reply