Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Playing a sprite above a physics objects
Started by DevilDev Jan 01 2019 05:13 PM

1 reply to this topic
sprite physics zombie derby
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

DevilDev

[GLOBAL: userInfoPane.html]
DevilDev
  • Enthusiast

  • 64 posts
  • Corona SDK

Hi
I want to make a game like zombie derby.
In that game,zombies should walk on the mountains as the car moves.
To achieve this,I am thinking of adding  two wheels to the "zombie"  and hiding them.
Attached File  dt.png   16.29KB   0 downloads
Then when we applyTorque(),the zombie will move.
Is there am better way to walk the zombies on  curve shaped object?
 


[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 424 posts
  • Corona SDK

The first problem I see is that your zombies would fall over on those steep hills. You'd also have to increase and decrease the torque as the zombies would be going up or down those slopes.

I would recommend looking into moving the zombies along curved paths. There are a few old tutorials on how to approach this:
https://coronalabs.com/blog/2014/01/07/tutorial-moving-objects-along-a-path/
https://coronalabs.com/blog/2014/09/09/tutorial-working-with-curved-paths/

This way, you would control the zombies movement completely and they'd move exactly as fast as you wanted.

Moving characters on slopes isn't really as easy as it may seem. There's a lot of tricks and hacks involved, and I don't know if any game actually does it realistically. Each game just sort of has its own cheat to handling slopes.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: sprite, physics, zombie derby