Question: How can I determine the place where an actor lands after getting hit?
Zwire
Member, PRO Posts: 182
Explanation:
I wanna have an actor stand somewhere on a certain position. After it gets hit with another actor it has to land for example 1 cm behind its previous place and not any further.
Do I have to make an integer and then make an attribute about position?
I cant figure it out.
Any help will be appreciated.
Comments
if actor1 overlaps or collides with actor2
interpolate self.position.x to self.position.x -1 in 0.3 seconds ( if you want over a period of time )
or
change attribute self.position.x to self.position.x - 1
Hi Icebox,
I dont think thats it. Tried both methods but it did nothing.
After the player is hit it has to automatically move to a fixed position where it can only be moved when hit again.
Here a picture of the situation:
@Zwire -- are the fixed positions at equidistant intervals? For example, is each fixed position always 50 pixels apart?
@Zwire Is this what you mean ?
I attached a demo in case you want it
Nice !
@Socks Thanks!
Hi Thurman,
Thanks for your reply.
Not necessarily. Its just about 2 random positions I made up.
Hi Icebox,
Thats exactly what I meant. Thanks!
It doesn't seem really fluid when getting knocked back. Is it better to make it animated when getting knocked back?
@Icebox, nice demo. Love the particle trail.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@Zwire Hello there sorry i just did it the way i prefer it to be , maybe play with the numbers or try other methods when it collides, i really dont know how fluid you would like it to be so it depends on you , I hope you find a solution though .
@jamie_c Thanks !