How do I get rid of this bugs in the positions?

0 favourites
  • 7 posts
  • Hi folks.

    I'm very new on Construct, so this problem could be easy to solve....but I can't figure out how.

    If you start this damn Programm which made me lost lots of hair I'm pretty sure you'll see where the problem is. It's about the floating stones and about the disappearing stones. I think it has something to do with overlapping stones if the position at the start of the layout is the same. Sitting here since days, can't fix it, need help or start crying.....

    -https://www.dropbox.com/s/43muovyvdbjeex9/Mahjong2.capx?dl=0

  • Ozymandiaz :

    The problem is, you create stones double (or more times) on the same position with your method, since you pick wrong.

    Because you say, if ANY tile is overlapping Sprite2, pick any tile from all tiles (also the ones not overlapping Sprite2).

    You mean, pick random tile, which IS overlapping Sprite2, and place it on screen.

    Capx attached. Also, better to say, if object is off screen, to spare one object, and the unnecessary collision checking.

    It solves your problem, but still, its not the best method, since it can happen, that some stones stay off screen. You need to make sure, they all get positioned.

    Use arrays to do that, like in the "scramble_scrabble" following example, just with 0 and 1-s (no stone or stone).

  • EDIT: like this, you have guaranteed, that you pick all stones off screen to distribute, but then there are no wholes

    Basically, the positions are not that important at all in your case, since you show random faces anyways. But the holes are very much important.

    Also, If you have to guarantee some stones appearing always in pairs, the letter solution is the best. Randomize faces and positions with holes in your array, then distribute stones with the selected face does the trick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot, mate! There are so many functions i don't know yet. But thanks to you, I know a little bit more:)

    Btw: the holes are not as bad. I think they do a nice random Leveldesign-part and I'll keep them. Maybe add some pieces of 'ground' in the air to make different layouts.

    However, you helped me a lot and I hope you'll have a wonderful time. Thanks again.

  • EDIT:

    I dont get this whole Array-Stuff. I know, i have to learn it somewhen, but so far I'm good without it. So I mixed your way and mine and the result is a perfect shuffle without any holes. Just as it meant to be:)

    -https://www.dropbox.com/s/jhy7bqkxuka5lgm/MahjongFinal.capx?dl=0

    Sure it's not Final. I still got to add music, backgrounds and a few levels, but the engine works and that was the hard part. You saved my weekend.

  • Not sure if this will help, but R0j0hound put up a rough mahyong game in the Arcade that also has a .capx download.

    If you're interested, the link is here: http://www.scirra.com/arcade/example/1520/mahjong

  • Ozymandiaz : I think they fall nicer, if you have holes (not just a big block of stones), but that's indeed just aesthetically speaking. Glad to help

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