Jump to content


Photo

score counter/enemy spawner


  • Please log in to reply
1 reply to this topic

#1 GreenhornGames

GreenhornGames

    GMC Member

  • GMC Member
  • 730 posts
  • Version:GM8

Posted 21 May 2012 - 11:51 AM

1.how to make an object in room which adds 1 to score every second?


2. i have this for spawning objects:


//Create event

alarm[0]=300


//Alarm 0 event

instance_create(random_range(view_xview,view_wview),
view_yview,obj_ninja_body);
alarm[0]=300+random(300)

how could i make the spawn rate increase? (so the alarm[0] fixed value of 300 and random value of 300 should decrease)
  • 0

#2 Creativita

Creativita

    GMC Member

  • GMC Member
  • 172 posts
  • Version:GM:Studio

Posted 21 May 2012 - 12:17 PM

1.To increase the score with the passing of each second, use:

Create Event:
alarm[0] = room_speed; //the room speed is equivalent to the number of frames executed each second

Alarm Event:
global.score += 1; //used to increase the score by 1
alarm[0] = room_speed; //used to reset the alarm

2.To decrease the random value each time, use:

alarm[0] = 300+random(value);
value -= 1;

This will only decrease the possible range of values each time. By using:

alarm[0] = 300+value;
value -= 1;

...You may actually increase the spawn rate.

Edited by Creativita, 21 May 2012 - 12:22 PM.

  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users