What am I doing wrong :|

For questions about using Classic.

Post » Fri Aug 15, 2008 3:11 pm

I suck at this. Why isn't this code making boxes that simply fall down when I release my mouse button? I'm obviously trying to create a crayon-physics-clone/demake :P

filedropper.com/crayclone
B
2
S
2
G
4
Posts: 110
Reputation: 1,670

Post » Fri Aug 15, 2008 8:11 pm

Try this method:

http://www.mediafire.com/download.php?vbx5byvuptd

It draws the boxes just fine, and they fall just fine. Buuuuut... there seems to be a problem with the collision mask in the physics object setting properly when the object is created, so the collision is wrong. It's a bug, needs to be addressed.

Edit:
Also, there doesn't seem to be any way of setting the hotspot of the box object, so I'd suggest using sprites, and set the hotspot in the corner so drawing looks normal. Otherwise, the point of the mouse cursor isn't lined up with the corner of the box during drawing.

Edit 2:
Also, if you draw "backwards" (that is, from right to left instead of left to right) then the box glitches out. You might want to add some events that keep the box from being drawn if the user is trying to draw right to left. A simple mousex compare should do the trick.

Edit 3:
Hmm, seems that the box also glitches out when trying to draw down to up as well, so a mousey restraint should also be put into place. Basically you'd want people to only be able to draw from the top left corner to the bottom right corner.

Alternately, I suppose you could just figure out some way of rotating the physics box when it's created so that it lines up with the drawing box. That way the player could draw it any which way they wanted.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Aug 16, 2008 5:57 pm

Oh. Well this sounds absolutely normal and I don't want to do it now ;D
B
2
S
2
G
4
Posts: 110
Reputation: 1,670

Post » Sat Aug 16, 2008 6:22 pm

I don't understand what you mean by "normal."
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: GameOverBeast and 1 guest