Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: badly need help with menu engine :o  (Read 1174 times)

0 Members and 1 Guest are viewing this topic.
badly need help with menu engine :o
« on: January 08, 2008, 08:10:09 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 7
I badly need help with my menu engine, I'm using LttP Menu Engine Created by Mitxela and i cant get it work correctly, I'm using GM7 and the engine is made for GM6 so thats might be the prob. OK my problem with the engine is that it keeps popping up when i try to close the menu.

Heres the code:
Code: [Select]
menuposx=84;menuposy=60 //position on screen
sound_play(wav_menu_open)
for(a=11;a>=0;a-=1){
screen_redraw()
draw_background(bg_menu,view_xport+(menuposx-24),(view_yport+menuposy)-(a*11)-20)
screen_refresh()
sleep(100/3)

}


curx=(global.item-5*(global.item div 5))-1
cury=(global.item-(global.item-5*(global.item div 5)))/5


do{
if curx<0 {curx+=5;cury-=1}
if curx>4 {curx-=5;cury+=1}
if cury<0 {cury+=4;}
if cury>3 {cury-=4;}
draw_background(bg_menu,view_xport+(menuposx-24),view_yport+(menuposy-20))  //draw the menu
for (iia=0;iia<4;iia+=1){ /*verticle lines*/ for (iib=0;iib<5;iib+=1){ /*horizontal lines*/ draw_sprite(spr_items,(iia*5)+iib,view_xport+menuposx+(iib*22),view_yport+menuposy+(iia*22))}} //draw all the items
draw_sprite(spr_selector,0,menuposx+(curx*22),menuposy+(cury*22))
screen_refresh(); keyboard_wait()  //wait for input
lk=keyboard_lastkey;
if lk=vk_left or lk= vk_right or lk=vk_up or lk= vk_down sound_play(wav_menu_move)
curx-=(lk = vk_left)
curx+= (lk = vk_right)
cury-= (lk = vk_up)
cury+= (lk = vk_down)

global.item=curx+(cury*5)
} until lk = vk_escape or lk = vk_enter  //until we can end
sound_play(wav_menu_close)
for(a=0;a<11;a+=1){
screen_redraw()
draw_background(bg_menu,view_xport+(menuposx-24),(view_yport+menuposy)-(a*11)-20)
screen_refresh()
sleep(100/3)
}


the code that should activate the menu code is on my player Object and I'm to lazy to print it because its just a variable change.
Please help me, i appreciate all kind of scripts, examples etc
// Jeggan
« Last Edit: January 10, 2008, 12:14:47 pm by jegge »
Logged
Re: badly need help with manu engine :o
« Reply #1 on: January 08, 2008, 08:31:28 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206
Pm this guy! since he's the creator of it he should be able to help you!
And btw, it's menu not manu.  :)
Logged
Re: badly need help with manu engine :o
« Reply #2 on: January 08, 2008, 10:26:06 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 7
thanks for the tip :) and sorry for the misspelling :P
Logged
Re: badly need help with manu engine :o
« Reply #3 on: January 08, 2008, 11:10:55 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206
thanks for the tip :) and sorry for the misspelling :P
No need to apologize to me! I was just pointing it out. :)
Logged

mit

Re: badly need help with menu engine :o
« Reply #4 on: January 09, 2008, 06:26:14 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
Without looking to closely, it sounds like you might have put something in the <key> event instead of the <key pressed> event - this is important, as the normal key event will activate continuously until it's released, which causes a problem if you've just pressed it to close the menu.

If that's not it, it might be that the game doesn't recognise that the key is released because the menu pauses the game and everything in it. Try putting, I think, keyboard_clear(vk_space) at just after closing the menu (assuming space is the button to close/open the menu).
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Re: badly need help with menu engine :o
« Reply #5 on: January 10, 2008, 12:13:58 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 7
it worked :D thanks for the help Mit
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.045 seconds with 49 queries.