(HELP/Beginner) How to have player mount on animal or creature objects

Ratha670

Member
For now I have a little experience on movement of the player, transitioning rooms, etc. One mechanic I'd like to try and solve is creating an object as an animal or creature of my game and able to ride it, and possibly attack enemies while doing so. Anyone got instructions or codes I could follow? I'd like to animate my sprite to change when riding.
 

Binsk

Member
What have you tried yourself? If you haven't tried yourself first then do so and come back if you have an issue and explain your method.
 

3dgeminis

Member
A simple solution is to have 3 objects, one for the player, one second for the animal, and a third with the player riding the animal. When the player goes to ride the animal, you destroy the player's objects and the animal while creating the player's item by riding the animal. In this way it is easier to program the behavior of each one separately.
 

Foldup

Member
Try what 3dgeminis said - that's the right way. You can then control the "riding" object with a whole different set of behaviors, including special mounted attacks.

You could mount or unmount the animal too with the same exact approach. Like, when you unmount, you destroy the "mounted" creature and create a player object and a creature.
 

Ratha670

Member
Thank you all! I guess that's a good start of planning. I'll just try and understand the variables for it and the state machine even further. If you got any basic code I'd follow, feel free haha
 
Top