What am I doing wrong :|

This forum is currently in read-only mode.
From the Asset Store
Be quick and choose whether the shown equation is right or wrong.
  • 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


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try this method:


    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.


    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.

  • Oh. Well this sounds absolutely normal and I don't want to do it now ;D

  • I don't understand what you mean by "normal."

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)