Fireball falling from the sky

D

deangeloalmeus!

Guest
Hello everyone am working on an endless runner and thought it would be cool to add some fireballs falling from the sky from one side of the screen to the next.. but i was wonder how can i do this... i been playing with the image direction and angle but can get it to do what i want.. i will upload a picture to show what am trying to do


https://drive.google.com/open?id=0B791jLjjuo-taE80TlFFVHF5UTA
 
D

deangeloalmeus!

Guest
Code:
instance_create(random_range(16, room_width - 16), -62, o_fireball);
This code just cause the fire ball to fall from top to bottom i havent figure out how to do it from the top right of the screen any suggestions ?
 

TheouAegis

Member
Well for starters, setting the range to span the left side to the right side won't make the fireballs fall from just the right side, now will it? Remove the random range for starters and set it to room_width-16 or even just room_width. Then set its direction to something like irandom_range(225,315) and give it a speed so that it will move.
 
D

deangeloalmeus!

Guest
This wont work did you click the picture and see what am trying to do i want the fireball to come from one end of the screen the top right coming downwards at an angle
 
W

warbo

Guest
You could probably create a spawn object up in that corner and when you want them to appear you just create the fireballs from that spawner object, could even add one to the opposite side so the fireball spawns at the spawner object in the top right and then "move-towards" the other "object" down in the bottom left.

Just a quick fix method and probably sloppy.
 
J

jackhigh24

Guest
just carefully read again what theou said and just change the direction to 180 to 225 range
 
D

deangeloalmeus!

Guest
okay so in the creat event of the fireball set the direction i got that part but when creating the fireballs with the spawner what should i use as the x and y coordinates
 
Top