Jump to content


raphael1

Member Since 26 Feb 2012
Offline Last Active Apr 08 2012 10:42 AM

Topics I've Started

passing a global variable to next room

07 April 2012 - 11:57 PM

So I have a script called Global Declaration with a variable called global.Timescore = 0; , and I have a alarm step that adds 1 to the global.Timescore every sec, when the timescore reaches 10 it's moves to a different room. I wanna be able to draw the last value that the global.Timescore stored, in this case it's 10. but it not working for some reason

my code:
script: global Declaration:
global.Timescore = 0;

obj_timer:
Create Event:
set variable global.Timescore to 0
set Alarm 0 to 30

Alarm Event for alarm 0
set variable global.Timescore relative to +1
if global.Timescore is larger than 10
 go to next room with transition effect <no effect>
else
  set Alarm 0 to 30

Draw Text
at position(0,0) draw the value of global.Timescore

Obj_draw:
draw_text(x,y,global.Timescore);

the obj_timer goes to room 0 and obj_draw goes to room 1

Any help appreciated

How to pass variable to another room

07 April 2012 - 08:29 PM

I have a game that has a counter the amount of second the player has been playing the current level. Is there a way to pass the information in the counter to next room, the display it.

For example Posted Image

How a created my counter

Create Event:
execute code:

// Declare the numeric variables
steps = 0;
seconds = 0;

// Declare the strings
draw_seconds = "";



 Step Event:
execute code:

steps+=1 // Add to the amount of time gone by (in steps)

seconds=floor(steps/room_speed) // Figure out the seconds

if (seconds<10) {

    draw_seconds=string(seconds)
}
else {
    draw_seconds=string(seconds)
}


Draw Event:
execute code:

draw_set_color(c_green)// Set draw colour
draw_text(x,y,draw_seconds) // Draw counter

Any help appreciated

play and pause sound

12 March 2012 - 01:11 PM

I Need help, I have a sound sprite, when the room start it plays the music with is on a loop, when a player clicks on the sprite the music  stops, if it clicked again it resume the music.

so far i Have created a games start event with play sound action, I don't know how to make it play and pause when the sprite is clicked

Any Help appreciated!

timer count up

01 March 2012 - 07:53 PM

How do I like make a timer that counts up? ( for (Example)

Rotate sprite in another sprite

28 February 2012 - 05:31 PM

I have got box sprite that's 400 by 400 pixel, and I manage to make it rotate 360 degrees every second using

create event = (timer = 30;)  in execute code

and a step event with


if(!timer) {
  image_angle = (image_angle + 1) mod 360
  timer = 30;
}
timer -= 1;


how would I make any sprite that is put inside or on top of the box sprite rotate as well in the same motion?

any help appreciated. :blush: