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

Get help using Construct 2

Post » Sat Mar 14, 2015 4:20 pm

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
B
3
Posts: 7
Reputation: 189

Post » Sat Mar 14, 2015 5:43 pm

> @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).
You do not have the required permissions to view the files attached to this post.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Sat Mar 14, 2015 5:51 pm

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.
You do not have the required permissions to view the files attached to this post.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Sat Mar 14, 2015 6:29 pm

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.
B
3
Posts: 7
Reputation: 189

Post » Sat Mar 14, 2015 7:39 pm

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.
B
3
Posts: 7
Reputation: 189

Post » Sat Mar 14, 2015 8:13 pm

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
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
74
Posts: 5,143
Reputation: 52,691

Post » Sun Mar 15, 2015 12:26 am

> @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 ;)
B
8
S
3
Posts: 197
Reputation: 1,207


Return to How do I....?

Who is online

Users browsing this forum: irbis, Yahoo [Bot], yuji567 and 8 guests