• 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!

New to GM2 need D&D programming help with top down shooter

A

auzzy

Guest
hey guys, Im making a game using drag & drop would like some help
See if i was to create an instance of an object, how would I then delete it a few seconds later ?
as I shoot my gun I would like bullet casings to fly out the side.
the bullet casings are flying out the side but now I need to have them disappear a few seconds later.
 
Last edited by a moderator:
A

auzzy

Guest
thanks, XD . I though it was something like that, so all game timers can be set using alarms?

well done , spot on btw.
 
A

auzzy

Guest
also , how would I create an instance at coordinates away from the center point of the sprite.
I want bullets to come out the end of my gun but i dont want to offset the centering for the sprite.
plz hlp...
 

FrostyCat

Redemption Seeker
In the Create Object Instance action, check both the x and y Relative boxes. Then depending on the perspective of your game, enter the offset from the origin there. This is usually in terms of a fixed value for side-on views or lengthdir_x() / lengthdir_y() for top-down views.
 
A

auzzy

Guest
thanks for the speedy response, frostycat .
so in the brackets is how much it offsets from origin.
x & y being origin yeah.
so whats a good example of what to put between brackets?
soz iz total noobers plz hlp
 
Last edited by a moderator:
A

auzzy

Guest
right im trying to have shells spewing out the side of my gun as i fire
but i cant seem to set the place the object is coming from or its direction properly
ive set up "set point direction","set speed" and "set instance rotation" on my object (bulletshell) but i cant
seem to make it come out the right direction.
at this point in time its set up like a bullet firing out the front only slower spd.
plz hlp
 

FrostyCat

Redemption Seeker
First of all, stop sending me PMs to get your way. I'm not your personal GM butler. The Manual is.

For your first question, read the Manual entry links from my previous post. The diagram there clearly shows the meaning of the two parameters. In your top-down perspective use case, use the distance from the sprite's origin to the tip as the first parameter and the facing direction as the second.

For your second question, don't do it from the bullet, do it from the source shooting the bullet. Read the Manual entry for the Create Object Instance action. The example clearly demonstrates how to set properties of the created bullet instance.

Being new does not give you a licence to be intrusive. I never bugged anyone like you did when I was new, I learned on my own and minded my own business. Until you learn to think for yourself, write like a sensible person and stop harrassing people into answering, this is my final reply to your topics.
 
A

auzzy

Guest
hahahahha yayyy making freinds XD i figured it oot anyway dollface
 
Top