• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Asteroids not appearing in Gamemaker Tutorial

T

Tai An Zhou

Guest
Hi all. I am making the Asteroids game from the GM Tutorials. For some reason the asteroids are not appearing :

sprite_index = choose(

spr_asteroid_small, spr_asteroid_med,

spr_asteroid_huge

);



direction = irandom_range(0,359);

image_angle = irandom_range(0,359);



speed = 1;



move_wrap(true,true,sprite_width/2);

image_angle = image_angle + 1;

This is my code. What am I doing wrong?

I am following the tutorial on YT.
 

FrostyCat

Redemption Seeker
Then you didn't pay enough attention to which events are being used in the tutorial. This definitely looks more like Step event code to me than Create event code:
Code:
move_wrap(true,true,sprite_width/2);
image_angle = image_angle + 1;
And if this kind of event mix-up isn't alone in what you've done so far, chances are you've made the same kind of mistake with the code generating the asteroids. Either you placed that too in the wrong event and/or object, or you didn't put an instance of that object in the room.

It's absolutely ANNOYING how rookies these days focus so much on getting the "right" code, but so little on putting it in the right place. You'd be a lunatic to take the lines you'd say at the bar on Friday night and at the church on Sunday morning, bunch them together and say it all at the bar.
 
T

Tai An Zhou

Guest
Thanks for your reply it worked. I am attempting to study the code and learn as best as I can. I do follow the tutorial to the best of my abilities.

Now on Part 4, I got this error :

FATAL ERROR in
action number 1
of Draw Event
for object obj_game:

with this code.

case rm_start:
var c = c_yellow;
draw_text_transformed_color(
room_width/2, 100, "SPACE ROCKS",
3, 3, 0, c,c,c,c, 1


I entered it into the Draw step as shown on the video. What gives?
 

Toque

Member
I believe that first code does go in the create event in that tutorial.

The tutorial does work as I did it a couple times. Rewatch and check spelling and capitals very carefully and events.

Coding is not forgiving that way.

Do the brick breaker tutorial as wel.
 
Thanks for your reply it worked. I am attempting to study the code and learn as best as I can. I do follow the tutorial to the best of my abilities.

Now on Part 4, I got this error :

FATAL ERROR in
action number 1
of Draw Event
for object obj_game:

with this code.

case rm_start:
var c = c_yellow;
draw_text_transformed_color(
room_width/2, 100, "SPACE ROCKS",
3, 3, 0, c,c,c,c, 1


I entered it into the Draw step as shown on the video. What gives?
Some of the error message is missing. Please post all of the error.

I think this code does go in the draw event given that it's calling draw_text_transformed_colour()
 
Top