Detect "W" or "X"

0 favourites
  • I am creating a Tower Blocks style game.

    When the Boxes drop, is there a way I can detect if the box is perfectly aligned with the box it drops onto?

    I'm assuming it should somehow read the Width or X Alignment of the previous block?

  • you can compare the X values of both boxes and if they are equal, they are aligned, asuming that both boxes are instances of the same object.

    If not, then you have to make sure, that the Imagepoint 0 is set to the same "value" on both sprites

  • you can compare the X values of both boxes and if they are equal, they are aligned, asuming that both boxes are instances of the same object.

    If not, then you have to make sure, that the Imagepoint 0 is set to the same "value" on both sprites

    The boxes are instances of the same object.

    Basically all that will happen if they are = to one another is a higher score and a change in animation.

    Could you perhaps show me? I'm Still quite new to C2.

    I'm guessing it would be attached to:

    <img src="http://i126.photobucket.com/albums/p96/gendv/Collision.jpg" border="0" />

  • It would be loads easier for both of us, if you could post your CAPX

  • lol. ok. Will compile one quick.

  • It would be loads easier for both of us, if you could post your CAPX

    Here you go.

    Tower Blocks

  • Two things i notice:

    • the boxes are very "bouncy". I even did not manage to get ONE on the plattform and at release time the first jump up
    • the drop behaviour is not correct, when it comes to physics...

    ...and now I take a look at the scoring, as you asked

  • Two things i notice:

    - the boxes are very "bouncy". I even did not manage to get ONE on the plattform and at release time the first jump up

    - the drop behaviour is not correct, when it comes to physics...

    ...and now I take a look at the scoring, as you asked

    It is hard, but do-able once you get the hang of it. You are most welcome to assist there if you so wish to do so.

    Thank you.

  • imagine how the boxes would drop in real life. as ist is right now, they just drop straight down from the point they are released. in real life the would arch....

  • Updated with more usable version

    http://dl.dropbox.com/u/67025590/C2/TowerHelp.capx

  • imagine how the boxes would drop in real life. as ist is right now, they just drop straight down from the point they are released. in real life the would arch....

    I am terrible with "The Laws of Physics" <img src="smileys/smiley9.gif" border="0" align="middle" /> But thank you for that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • scoring really is tricky....I'll need some time

  • Much appreciated.

  • So...here is my solution -> CAPX

    I hope you like and understand it. If so, and you want more help, just let me know

  • Thanks so much for your help, but I think that maybe you are misunderstanding my goal?

    Have a look here at the game I am building. This should clarify:

    Tower Blocks

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