Fasteroids Update - GameMaker irandom(1) evaluation

  • Posted on: 22 July 2018
  • By: charm
GML for UFO direction

A little more progress this morning on Fasteroids. One of the things I wasn't sure of was whether irandom(1) was evaluating properly. I discovered it was evaluating properly, what wasn't working was the UFO coming in from the right and moving to the left. I still haven't figured out why this isn't happening, but I figured out the evaluation by inserting a room_goto(room_howtoplay) to re-direct the right to left movement so that it just jumps to the game instructions room.

The other thing I figured out is that the alarm[1] event wasn't getting reset after firing. In the spawner event I just added an alarm[1]=300; after the if/else evaluation and it seemed to reset the alarm. To trap things so that the UFO doesn't spawn more than 1 on the screen I wrapped the ufo creation event in another evaluation:

if(!instance_exists(obj_ufo))
{
    instance_create(x_start,y_start,obj_ufo);
}