Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: The_Northridge on January 01, 2014, 01:25:56 PM

Title: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: The_Northridge on January 01, 2014, 01:25:56 PM
Hi!

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

(http://imgur.com/tWS9Dgu)

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
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: jeanfabre on January 02, 2014, 09:08:56 AM
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
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: The_Northridge on January 02, 2014, 06:44:11 PM
Hi Jean,

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

My apologies for not making this more clear!

-Sean
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: jeanfabre on January 03, 2014, 04:39:19 AM
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
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: colpolstudios on January 03, 2014, 05:44:58 AM
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??
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: The_Northridge on January 03, 2014, 01:42:44 PM
Wow Colpol! Thats exactly what I'm looking for! Sent you a PM :)
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: jeanfabre on January 06, 2014, 08:31:20 AM
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
Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: colpolstudios on January 06, 2014, 09:54:02 AM
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?

Title: Re: Doom like sprites: Changing sprite animation based on direction of movement?
Post by: jeanfabre on January 07, 2014, 04:40:24 AM
Hi,

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

bye,

 Jean