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
(I’ve also uploaded the snapshot of the event I’m using)
OK a quick question…
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: dl.dropboxusercontent.com/u/210143/RUN.zip 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
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.
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
Ughh… Not working
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)
SNOWBALLER.zip (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
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 , 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?
Unless he set origin midway
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( ).
And ya self.width does not work, my bad (I was recently trying to make a java game so… ).
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?