Game Hanging Upon Pressing Left

For questions about using Classic.

Post » Fri Sep 17, 2010 12:49 pm

Sorry to bring up such a weird error, but whenever I press the Left Arrow Key, the game freezes up and slows down dramatically. Hopefully there is a simple solution! Here is my cap file.

http://www.mediafire.com/?wz15yb8pnuxivic
B
2
G
4
Posts: 9
Reputation: 1,068

Post » Fri Sep 17, 2010 1:37 pm

After getting no good results from toggling off every event, i started to look at your layout and objects. The main problem is that you have sprites that are gigantic, mainly your ground sprite (sprite2), one of them is 12718 pixels wide. After removing a lot of them and resizing some i managed to get the game running smoothly again.

There's a few things you can do to fix this, instead of using a sprite object, use the TiledBackground object, its much faster when your going to be resizing things that much. If that fails or you insist on using sprites, split the huge ones into lots of smaller ones.

I also recommend aligning all your objects with the grid because they are kinda messy right now, but its your game :D
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Fri Sep 17, 2010 1:54 pm

Oh, wow, that was a fast reply! Thanks!

Well, not to be a pest, but would you mind sending me the fixed cap file? I'm happy to give it a go with any of the changes you included and I'd like to see this tiled background you're talking about.
B
2
G
4
Posts: 9
Reputation: 1,068

Post » Fri Sep 17, 2010 2:27 pm

I will be honest, i didn't actually save the fixes! However, i just went in to re-do them and pin-pointed the problem down to one object - It's the Chomposaur's!!! I can't figure out why they are doing it, but if you completely remove the Chomposaur object, the problem goes away.

Sorry i can't really help more than that, this one has me stumped.
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Fri Sep 17, 2010 2:49 pm

Well, you are too kind. Thanks for your help :)
B
2
G
4
Posts: 9
Reputation: 1,068

Post » Fri Sep 17, 2010 3:51 pm

I changed the sprite, but it's still happening. If anyone else could shed some light on this, it would help a lot.

http://www.mediafire.com/?3ja5thkbxinot5x
B
2
G
4
Posts: 9
Reputation: 1,068

Post » Fri Sep 17, 2010 8:15 pm

[url:38ujw32v]http://dl.dropbox.com/u/7658043/Fixed.cap[/url:38ujw32v]

Hopefully i fixed your problem now.The new cap was done with v99.94 of Construct.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Fri Sep 17, 2010 8:45 pm

The slowdown is due to construct recalculating the collision mask on resized objects for each frame. It's from a fix that I made in construct since 0.9984. Prior to that, the collision mask wouldn't get updated unless the object was resized or rotated. The only drawback is it seems to be one of the main sources of slowdown encountered in projects. The slowdown is avoided if collisions are not continuously compared with animated, resized objects.

Anyway in your case the solution is to have a separate object that handles all the collisions.

Here is a fixed cap
[url:3epi0o85]http://dl.dropbox.com/u/5426011/examples2/fixedreadthesigns.cap[/url:3epi0o85]
saved with 0.99.94

Edit :
DravenX's solution of setting the guy's collision to box will work, but by looking at your Hitbox animations you want the hit box to be smaller than the sprite. In which case another object should be used.

-cheers
B
79
S
24
G
54
Posts: 4,750
Reputation: 40,763

Post » Fri Sep 17, 2010 8:55 pm

Yes Rojohound is right.I didn't take the hitbox into account.Anyway never fear when Rojo's near.I wish i was half as good as Rojo then i would be able to create the games i really want to create.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Sat Sep 18, 2010 7:25 am

Okay, I'll download 0.99.94. Thanks!
B
2
G
4
Posts: 9
Reputation: 1,068

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests