Sorry if this has come up before (I've searched the forums and came up blank) but, well, when I was a wee lad messing about in TGF all those years ago I encountered a problem importing graphics from paint, in that no matter what I did, the sprite seemed to always spaz about randomly from frame to frame. I always knew it was because of the hotspots but I could never figure out a good workflow for getting this sorted. Being 13, I eventually gave up and went outside instead.
So, been fiddling with construct, and started having the exact same problem. So, um, help! I'm trying to import a Mario sprite with the goal being to build a simple engine and then just go a bit nuts with it figuring out all the new dx9 effects. I've got a spritesheet I got off the interweb, and I've been trying to copy/paste from Paint into Construct. I've assigned the platform behavior to mario but haven't changed any variables.
Mario falls onto the test platform fine. Then, when I move, he'll either spaz through the frames really really quickly then just go to the first frame and get stuck. I've checked that the animations looping - it is. If I jump (I haven't put in the jumping animation yet) he'll spaz wildly in the air, doing all the walking frames, and when he lands just go back to being stuck in whatever frame he landed in. Also, stopping moving doesn't return him to the standing animation.
So, construct genius-types, When it comes to importing sprites, whats your workflow? I noticed that there is an import feature that cuts up a big sheet, but I always seem to slice up my sheet. Is there any set way to organise the sprites in here perhaps? Or if I'm copy-pasting, how do you prevent the hotspot screwing everything up? If anyone could paste like a step-by-step guide I'll be especially thankful and send hugs and kisses and maybe my mum if your interested.
I'd be guessing it's either the hotspots aren't consistent, or the sizes for every frame are differennt.
But if you really need help, you might want to upload the cap file so we could look at it better.
Have you tried cropping and then centering the hotspot for every frame? (5 on the num pad)
have you tried making a seperate collision box for the movment, then positioning the mario sprite over it every frame?
Tried hitting 5 on the numpad, it centred the hotspot but didn't cure all my problems though, so I'm wondering if thats where the problem lies. The sprite still sticks when running on the same frame (I haven't imported the jumping animation yet, so when I jump the running animation plays - interestingly it loops through ok then)
I have considered using another object and sticking the sprite over it like-wot-done-in-the-tutorial, but this seems to be the same problem I've had going back to TGF a while ago, so I'm curious as to how I get over it?
I've stuck the .cap up at .
Okay. The problem has nothing to do with importing sprites... everyone has been giving you advice on setting your hotspots and cropping and whatnot, and that has nothing to do with the animation issue. So if you want relevant advice, you need to ask relevant questions
The problem you're having is it appears that the animation tags aren't working properly. Using events to set the animation works fine.
Secondly, there's an issue with your sprite intersecting the ground because the second frame of your walking animation is a different size than your first frame. So, when frame 2 shows up, Mario falls a little bit, then frame 1 shows up, and suddenly Mario is stuck in the ground and the Platform Behavior has to push him out. This is interfering with your animations as well.
To fix this you should use a separate bounding box for your platform behavior object. Make a plain rectangle and use that instead of your animated Mario sprite. Since the rectangle has only one frame of animation it won't change size, and therefore won't intersect the ground and cause weird behavior.
(In an upcoming build there's a plan to have separate collision boxes that you can draw in the Picture Editor so you won't need to use a separate sprite, but until then this is how you'll have to do it.)
Third, your animations were too fast, I slowed them down to 10 frames per second. I also added a second angle and some events to change the animation. Works fine now:
Let me know when you get the file so I can clear it from my dropbox. And may I recommend you check out my Platform School tutorial? It explains this kind of stuff in detail.
Cheers Deadeye. Got the file, I've also actually been working through your tutorials tonight prior to me reading your post. (I like the playable tutorial style btw, it does make things very easy to follow, so cheers for your tutorial as well!)
So, just to make sure I'm following - use a bounding box to control everything and handle the animations via events rather than relying on construct? Think I've gotcha.
Develop games in your browser. Powerful, performant & highly capable.
I noticed this problem with tagged animations too. You don't really need events to fix it though, apart from 1 always event that is.
You can still have all the tagged animations on your invisible dummy sprite. Like mentioned above the actual image of the different animations should be all the same rectangle.
Now with your visible player sprite you need to use the same animation names. You don't need to tag them. Finally make an always event which sets the visible player animation to dummy.animname.
For some reason this works.
I believe tagged animations are a little wonky at the mo, will have a look for the next build.