playMaker

Author Topic: Doom like sprites: Changing sprite animation based on direction of movement?  (Read 6701 times)

The_Northridge

  • Playmaker Newbie
  • *
  • Posts: 5
Hi!

I've been working on a Retro FPS, I've just started on the sprite system for it.



I've got the guy all set up and working. He always faces you when your looking at him and animates when walking.

I'm wondering if you guys had any ideas on how to change his animation depending on what direction he's moving in. Examples such as if he were to walk left, he would change to a side walking profile, or if he walks away from the player, you'd see his back.

Any help would be appreciated!

-The_Northridge

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 If your camera work is what I think, then you simply need to bind user inputs with animations.

 the user goes left, play the left animation, same with right.
the user goes forward, play the back animation ( walking away from you)
the user goes backward, play the front animation ( walking towards you)

 Else, can you describe how your camera works and how it relates to the player movement?

Bye,

Jean

The_Northridge

  • Playmaker Newbie
  • *
  • Posts: 5
Hi Jean,

I forgot. This isn't the player sprite, these are the enemy's.

My apologies for not making this more clear!

-Sean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 No problem :)

 So for this you'll need a way to find the angle of your enemy. I created a custom action to do that.

http://hutonggames.com/playmakerforum/index.php?topic=1027.msg4256#msg4256

Since it will return a signed angle, you can know for sure what is the direction between the camera and the enemy and trigger the right animation based on the angle. Using "float compare" to trigger events based on the ranges of angles.

Bye,

Jean

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Hope you do not mind me jumping in here.

Simply ensure you create the animations in the directions you need.

Example: http://hutonggames.com/playmakerforum/index.php?topic=5691.0

The player is a sprite but with eight directions, when you press a key to change direction i simply play the according direction.

I am using simple sprite, but there are better systems that handle sprites.

I also need a better camera setup.

But if you have Daz Studios or Poser content you could design you own character and use the rendered result for gaming.

Daz troll would be a good replacement for your enemy maybe??

The_Northridge

  • Playmaker Newbie
  • *
  • Posts: 5
Wow Colpol! Thats exactly what I'm looking for! Sent you a PM :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hope you do not mind me jumping in here.

Of course not!! By all means please share your knowledge and experience. I forgot about that thread, so ti's very good that you step in actually!

bye,

 Jean

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
No Problem Jean.

I had issues with my old camera setup, so i have been busy re-working it.

https://dl.dropboxusercontent.com/u/150707256/Camera%20update/webplayer.html

The stealth done camera is no longer in use.

New C# script now controlling the camera.

Issues: There are hanging ropes/cables and other elements that will get in the way.

I just do not have the time to find and assign these elements to a new layer.

My biggest challange is to find a better free way to manage the sprites.

This current webplayer uses simple sprite which I re-coded to improve on the abilities of the system.

Simple sprite and the pro verson just do not offer enough.

The sprite tutorial using playmaker is were im going next.

Possibly you know of another premade free system?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 I would look up the asset store, I don't have much experience on that front using various sprite systems.

bye,

 Jean