Get ready function - Help - Game Design - Forums
Tuesday, 2009-11-24, 11:16 Am
MainRegistrationLogin Welcome Guest | RSS

[New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum moderator: RomsMaster 
Forums » Game Design » Help » Get ready function
Get ready function
ZaeDate: Wednesday, 2009-01-07, 10:09 Am | Message # 1
~Bladed Glory~ & king of Nightmares!
Group: Moderators
Messages: 138
Reputation: 1
Status: Offline
My D&D: next room function wont work: whenevr i press space at the end of the score (the button to link to the next level) it just repeats the score and music. Can anyone help!
below is my information for the game controller and the score controller (also controls the next level contols)
here is information for my Game_contoller:

Code
Information about object: Game Controller

Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
if number of objects Point is Equal to 0
        create instance of object Score at position (200,0)
        create instance of object Nothing at position (0,0)
        destroy the instance

Step Event:
if number of objects Point is Equal to 0
        play sound sound9; looping: false
        set variable time to 1
        sleep 3000 milliseconds; redrawing the screen: true
        set variable time to 2
        sleep 3000 milliseconds; redrawing the screen: true
        set variable time to 3
        sleep 3000 milliseconds; redrawing the screen: true
        set variable time to 4
        sleep 6000 milliseconds; redrawing the screen: true
        set variable time to 5
        sleep 3000 milliseconds; redrawing the screen: true

Other Event: No More Lives:
If lives are equal to 0
        play sound Win; looping: false
        show the highscore table
      background: Main Menu BG
       show the border
       new color: 0, other color: 255
       Font: "Press Start K",10,0,1,0,0,0
        restart the game

Draw Event:
set the font for drawing text to main_font and align left
set the drawing color to 16777215
at position (256,10) draw the value of score with caption Pac-Points:   
if time is equal to 1
        at position (160,100) draw text: Level Complete!
if time is equal to 2
        at position (160,100) draw text: Level Complete!
        at position (160,200) draw the value of score with caption Level Score:   
if time is equal to 3
        at position (160,100) draw text: Level Complete!
        at position (160,200) draw the value of score with caption Level Score:   
        at position (160,244) draw text: End of level Bonus: +100
if time is equal to 4
        at position (160,100) draw text: Level Complete!
        at position (160,244) draw text: End of level Bonus: +100
        set the score relative to 100
        at position (160,288) draw the value of score with caption Level Score:   
if time is equal to 5
        at position (160,100) draw text: Level Complete!
        at position (160,244) draw text: End of level Bonus: +100
        at position (160,288) draw the value of score with caption Level Score:   
        at position (160,400) draw text: Press Space!

The score controller:

Information about object: Score

Code
Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Keyboard Event for <Space> Key:
if at position (0,0) there is object Nothing
        set Alarm 5 to 0
        if next room exists
              go to next room with transition effect Blend
        else
              show the highscore table
      background: Main Menu BG
       show the border
       new color: 0, other color: 255
       Font: "Press Start K",10,0,1,0,0,0
              go to room Main Menu with transition effect Blend

Draw Event:
draw the lives at (2,2) with sprite spr_Lives

Can anyone help?!?!?!


All hail the bunnies!

Message edited by Zae - Wednesday, 2009-01-07, 10:09 Am
 
billyroDate: Wednesday, 2009-01-07, 10:17 Am | Message # 2
Game Maker
Group: Moderators
Messages: 248
Reputation: 8
Status: Offline
your step event in game controller pauses the game for that number of milliseconds, but since it is in the step event it always repeats, try setting a variable in the game controller's create event.
remove the sleep functions and it won't stop forever.



 
ZaeDate: Wednesday, 2009-01-07, 11:17 Am | Message # 3
~Bladed Glory~ & king of Nightmares!
Group: Moderators
Messages: 138
Reputation: 1
Status: Offline
i created the variable 'Zae' so that after all the points in the map is used, it increases by one, therefore activating the step trigger, but for some reason it dosnt work!!!

Code
Information about object: Game Controller

Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
if number of objects Point is Equal to 0
       set variable Zae to 1
       create instance of object Score at position (200,0)
       create instance of object Nothing at position (0,0)
       destroy the instance

  Step Event:
if Zae is equal to 1
       play sound sound9; looping: false
       set variable time to 1
       sleep 3000 milliseconds; redrawing the screen: true
       set variable time to 2
       sleep 3000 milliseconds; redrawing the screen: true
       set variable time to 3
       sleep 3000 milliseconds; redrawing the screen: true
       set variable time to 4
       sleep 6000 milliseconds; redrawing the screen: true
       set variable time to 5
       sleep 3000 milliseconds; redrawing the screen: true
       set variable Zae to 0

Other Event: No More Lives:
If lives are equal to 0
       play sound Win; looping: false
       show the highscore table
     background: Main Menu BG
      show the border
      new color: 0, other color: 255
      Font: "Press Start K",10,0,1,0,0,0
       restart the game

Draw Event:
set the font for drawing text to main_font and align left
set the drawing color to 16777215
at position (256,10) draw the value of score with caption Pac-Points:  
if time is equal to 1
       at position (160,100) draw text: Level Complete!
if time is equal to 2
       at position (160,100) draw text: Level Complete!
       at position (160,200) draw the value of score with caption Level Score:  
if time is equal to 3
       at position (160,100) draw text: Level Complete!
       at position (160,200) draw the value of score with caption Level Score:  
       at position (160,244) draw text: End of level Bonus: +100
if time is equal to 4
       at position (160,100) draw text: Level Complete!
       at position (160,244) draw text: End of level Bonus: +100
       set the score relative to 100
       at position (160,288) draw the value of score with caption Level Score:  
if time is equal to 5
       at position (160,100) draw text: Level Complete!
       at position (160,244) draw text: End of level Bonus: +100
       at position (160,288) draw the value of score with caption Level Score:  
       at position (160,400) draw text: Press Space!

Code
Information about object: Score

Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Keyboard Event for <Space> Key:
if at position (0,0) there is object Nothing
       set Alarm 5 to 0
       if next room exists
             go to next room with transition effect Blend
       else
             show the highscore table
     background: Main Menu BG
      show the border
      new color: 0, other color: 255
      Font: "Press Start K",10,0,1,0,0,0
             go to room Main Menu with transition effect Blend

Draw Event:
draw the lives at (2,2) with sprite spr_Lives


All hail the bunnies!
 
billyroDate: Wednesday, 2009-01-07, 12:46 Pm | Message # 4
Game Maker
Group: Moderators
Messages: 248
Reputation: 8
Status: Offline
you have it the wrong way around, you set it different in the step event before creating it.
The variable Zae should start as 0 in the create event, thats it. In the step event you need to make
if Zae=0, then do all the sleep effects and stuff and at the end of that set Zae to 1, then it wont repeat.



 
ZaeDate: Thursday, 2009-01-08, 0:11 Am | Message # 5
~Bladed Glory~ & king of Nightmares!
Group: Moderators
Messages: 138
Reputation: 1
Status: Offline
sad it wont work
im never going to learn this =(

All hail the bunnies!
 
billyroDate: Thursday, 2009-01-08, 3:21 Am | Message # 6
Game Maker
Group: Moderators
Messages: 248
Reputation: 8
Status: Offline
if you let me have the gmk, i'll make it work. just tell me what I need to do exactly.



 
ZaeDate: Thursday, 2009-01-08, 8:49 Am | Message # 7
~Bladed Glory~ & king of Nightmares!
Group: Moderators
Messages: 138
Reputation: 1
Status: Offline
k. i someone on the GMC told me a different way of doing it
Ill PM you the engine later. i got to get off the computer
All you have to do is fiddle around with the contollers and variables, create what you wish
Well, l8r

All hail the bunnies!
 
billyroDate: Thursday, 2009-01-08, 1:20 Pm | Message # 8
Game Maker
Group: Moderators
Messages: 248
Reputation: 8
Status: Offline
I got it and made it.



 
Forums » Game Design » Help » Get ready function
Page 1 of 11
Search:

Copyright MyCorp © 2009
Site managed by uCoz system