Asteroids not appearing in Gamemaker Tutorial

Discussion in 'Programming' started by Tai An Zhou, Mar 17, 2019.

  1. Tai An Zhou

    Tai An Zhou Member

    Joined:
    Mar 3, 2019
    Posts:
    5
    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.
     
  2. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    254
    Is this Step event or Create event?
     
  3. Tai An Zhou

    Tai An Zhou Member

    Joined:
    Mar 3, 2019
    Posts:
    5
  4. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    3,716
    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.
     
  5. Megax60

    Megax60 Member

    Joined:
    Jun 22, 2017
    Posts:
    56
    dont just copy and paste the code, study it
     
    Edwin likes this.
  6. Tai An Zhou

    Tai An Zhou Member

    Joined:
    Mar 3, 2019
    Posts:
    5
    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?
     
  7. Toque

    Toque Member

    Joined:
    May 25, 2017
    Posts:
    736
    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.
     
  8. IndianaBones

    IndianaBones Member

    Joined:
    Jul 5, 2016
    Posts:
    1,955
    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()
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice