Its getting impossible to make bullets

OK a quick question…
I’m making an endless runner for my next game. So there’s gonna be a player who is running(only the animation, the player is actually in the same position) and I’m trying to fire trees as bullets from one side(to give the illusion of running). I just cannot get that thing to work :frowning: :cry:
(I’ve also uploaded the snapshot of the event I’m using)

Try to add “Reset Timer TreeThrow” to “At beginning of scene”. It is known to resolve bugs like that.

//edit: Here’s my way of doing runner game. It isn’t perfect, but you should get gist of how it should be done: You are free to use any and all gfx assets in this project (all made by yours truly).

The event seems correct… What’s the problem exactly? No bullet are being shot?

What is the force’s damping?
You should set damping = 1, because you add the force only one time.

The problem is that you forces the trees to move -50 only every 1 sec. So you create a tree, move it -50 and wait 1 sec, move -50 again and wait 1 sec again. To move trees every frame as soon as it created, use the force action in a different event with no conditions. Use timer only to create trees every 1 sec and force trees to move in a different event.

I think he moves each tree only one time, the force action is under an object cretion, so the created object is the only one taken into account :confused:
If set damping = 1, the force applied one time will moves the tree forever, the same as an “always” event with damping = 0, as ddabrahim example.

The example was a bit tacky but the method you mentioned (-80*TimeDelta()) doesn’t seem to work very well for me. :frowning:

I don’t understand the problem exactly. I have generated trees outside the layout but they seem to be staying there itself. There are no trees entering the layout so maybe no bullets being shot.

The damping is pretty much 1.

OK let me try that out :neutral_face:

Ughh… Not working :frowning:

I just tried that but it didn’t work.

BTW: I also tried putting an object of the tree somewhere outside the layout(a problem I used to face in my days with construct 2-for atleast one instance of the object was required) but in vain.

Oh n I should have uploaded the gdg. Here it is(those are not my sprites-I’ve borrowed them from other ppl from the internet-Please Note that Credit is yet to be given oh n yeah everything I’ve borrowed is legally allowed for commercial use under different licenses) (487 KB)

Your damping is still =0 when it should be =1. Also, you have not entered any object for the force to be added to.

Add to a force

Should read:

Add to Tree a force

For the final event, does Self.Width() work? I thought it had to be the name of the object i.e. Tree.Width().

Beautiful :laughing: , in the first image the object is passed as parameter (properly)

No, it doesn’t work, the Tree is deleted if Tree.X() < 0 (zero by default, because a failed expression)
Also (this is just because I’m curious), why delete the Tree when only half of it has left the screen? :confused:

Unless he set origin midway :wink:

I had changed it to 1 and I had also set the object name. But I had copied the gdg before saving so maybe that’s why(my autosaves are off bcoz they keep crashing GD).Weirdly, I downloaded my own attachment again and did the same changes and to my shock it works( :confused: ).

And ya self.width does not work, my bad :smiley: (I was recently trying to make a java game so…:slight_smile: ).

Kind of forgot that the origin is not the centre. Thanks for reminding.

And guys thanks for being such a great help!!
Oh and I am making android games from gamedevelop so I was asking so many questions.

How do you make Android game from GD if GD lacks Android export? :confused:

Intel XDK