Hi guys,
So I think I'm getting the hang of Gideros
. I love the power and simplicity, especially coming from Obj-C and Marmalade Quick (which I found to be buggy).
Anyway, I'm at the point where I've got all my scrolling backgrounds working OK on my infinite runner prototype and started work on the player character. I've added a movieclip of him running so that's good, only thing I'm curious about is design-wise, should I stop the animation and set a single frame for when he jumps or something? I also need to add a physics body for collision detection but it feels weird adding a body to a movieclip.
I initially had a player sprite and was trying to add the movieclip to that sprite but it was just displaying both the clip and the original sprite, layered on top of each other.
All the best,
- D
Comments
Having a single frame animation for jumping is fine in most cases, it really comes down to what looks good to you. If you have assets with a running to jumping transition then I'd use that.
Are you using simple rectangular shapes for collision or are you using something more complex like circles or triangles?
Likes: simwhi
In my current project I load and play all states, then hide the states I'm not using. This has the advantage of allowing seamless switching between states. My game is isometric-ish and it's nice to not interrupt the run cycle when changing direction. It may seem wasteful to always play the MovieClips, but performance is fine as long as you use setVisible().
If you're thinking of using Box2D for collisions it's usually better to attach the graphic to the collision Body, rather than the other way around. Forcing the Body to move to where the graphic is can appear jumpy when a collision happens.
Likes: simwhi, Astirian
I'll just be using basic rectangles for collision detection. The way I'd do it before is by creating a player sprite then assigning a frame animation to it for running, then for jumping I'd just assign the jump animation.
I'd use something like player:setAnimation(run) in Marmalade, just not sure how to assign my MovieClip object to my player sprite in this instance though.
At the moment I have this pretty much; my Player:init() creates the sprite in my Player core class. I add my running animation function in my player class then call everything from the game scene:
I'm sure I'm probably doing a couple of things wrong here.
Likes: Astirian
https://deluxepixel.com
Likes: SinisterSoft
https://deluxepixel.com
With regards to your animation issues. Have you checked out the Bird and TexturePack example projects that come with Gideros? They will give you a better insight on how MovieClip works. If I get time today I'll throw together a small example for you too.
Likes: n1cke, Astirian
Using the controls you can run and jump about. If you fall off the green shapes or touch the red shape you die ("dead" animation plays).
The code is not very well commented and a bit messy since I just tossed it together this afternoon but you should get the general idea from it I hope. If you have any questions just ask
Likes: Astirian, Atavismus
Thanks for the demo @antix! I'll try it now. Should keep me out of trouble for a little while.
P.S Had a look at your games guys, they look great. @totebo nice pixel art on Miner Z! Do you do it yourself? I do mine myself but it takes so long, I'd be keen to outsource that.
Likes: Astirian
Likes: Astirian, HubertRonald
Likes: antix
One thing to remember when viewing assets on stores is that most often they are NOT complete so whilst the assets on sale might be okay for one level of a game.. they are by no means ready for use in a game with more than one level.
Likes: Astirian