Help - my bomb isnt appearing.

Discussion in 'Programming' started by DreTazzz, Aug 20, 2019.

  1. DreTazzz

    DreTazzz Member

    Joined:
    Jun 14, 2019
    Posts:
    8
    Hi there. I coded to have a Protagonist on a path...when he reaches the end of the path he stops, and then he should create a bomb that appears in his hand. The bomb is not appearing. I already created a sprite and object for the bomb. Everything else works fine. Suggestions please? :)

    I attached a snapshot of the Events for the Protagonist.
     

    Attached Files:

  2. squirrelah

    squirrelah Member

    Joined:
    Mar 30, 2018
    Posts:
    29
    I am not super familiar with the drag and drop game making section, but when I am programming and something isn't appearing after its been created 99% of the time its because in the draw section I forgot to add draw_self();

    That or the object gets placed but i don't have it updating where it should be. So if you have the bomb spawn somewhere off-screen, and it's not being told to constantly follow the player around it will just stay there.
     
    DreTazzz likes this.
  3. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    415
    you are creating it at the same x an y as the player you likely need to look at the offset between the origin of the sprite and where you want the bomb to appear in his and adjust your creation spot. The bomb is likely behind the protagonist object.
     
  4. johnwo

    johnwo Member

    Joined:
    Jun 20, 2016
    Posts:
    239
    You're setting the Alarm0 timeout in the alarm itself, so I assume looping is the intention?
    Where do you set the alarm first?
     
    Last edited: Aug 20, 2019
  5. DreTazzz

    DreTazzz Member

    Joined:
    Jun 14, 2019
    Posts:
    8
    Ok, thank you very much for responding. I will look into that. :)
     
  6. DreTazzz

    DreTazzz Member

    Joined:
    Jun 14, 2019
    Posts:
    8
    Hello. Yes, looping is the intent. I first set the Alarm under Create, because I initially need it to start a little later - after the room starts with a little intro.
     
  7. DreTazzz

    DreTazzz Member

    Joined:
    Jun 14, 2019
    Posts:
    8
    Hi there. I made the origin of the spirte bomb at the bottom of the bomb (43,110)...and I made the origin of the sprite Protagonist at the top of his hand (71, 131) - hoping it would make the bomb appear on his hand. I have both objects of the sprites at same depth of -70. How do I figure the offset, please?

    I created the objec bomb to appear at Protagonist.x and Protagonist.y
     
  8. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    415
    I wouldn't over look johnwo suggestion either. but you should be able to tell the offset from the sprite editor.
     
  9. jackquake

    jackquake Member

    Joined:
    Aug 17, 2016
    Posts:
    81
    Also you may want to check out the lengthdir functions designed for this sort of thing. Here is a good tutorial if this is new to you.
     
  10. johnwo

    johnwo Member

    Joined:
    Jun 20, 2016
    Posts:
    239
    Try creating the instance before setting the path.
    I don't use DnD but I assume that "Set Path" sets x/y to the start of the path, thus making the new instance create at that position.
     

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