Mario has epilepsy - AKA help me import a sprite!!

For questions about using Classic.

Post » Mon Apr 06, 2009 9:13 pm

Heylp! Heylp!

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.

Cheers!

8bitmonkeywhodoesn'tknowwhatthefeckhe'sdoing :mrgreen:
B
1
G
3
Posts: 4
Reputation: 833

Post » Mon Apr 06, 2009 9:44 pm

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.
B
16
S
10
G
5
Posts: 255
Reputation: 3,934

Post » Mon Apr 06, 2009 10:27 pm

Have you tried cropping and then centering the hotspot for every frame? (5 on the num pad)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Tue Apr 07, 2009 11:05 am

have you tried making a seperate collision box for the movment, then positioning the mario sprite over it every frame?
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Tue Apr 07, 2009 6:53 pm

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 viewtopic.php?f=16&t=3329.


thankyoumuchlove xx
B
1
G
3
Posts: 4
Reputation: 833

Post » Tue Apr 07, 2009 8:46 pm

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:

(link removed)

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. :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Apr 07, 2009 8:56 pm

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.

Cheers mate!
B
1
G
3
Posts: 4
Reputation: 833

Post » Tue Apr 07, 2009 9:52 pm

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.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Apr 07, 2009 10:36 pm

I believe tagged animations are a little wonky at the mo, will have a look for the next build.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests