hi… I’m trying to make a classic puzzle game to test my understanding of and grow my knowledge, experience about it.
I’ve made 9 tiles as board tiles to help me in creating system of movement.
every instance of board tile has its id.
tile object variable id =0, for instance 1 =1 ,instance 2=2 …etc.
on top of board tiles there is 8 green tiles which can be moved.
every instance of tile has its id based on scene array variable so I can shuffle tiles every beginning of scene.
shuffling and movement systems are succeed.
now I want to learn how to make system of winning based on picking instance of tile and check if it’s on the board with same id.
if 8 tiles on 8 board tiles with same id, player wins.
I’ve tried many things
in events but didn’t work because there is always a collision between tile and board and ids are equals too so its true, what should I do
I don’t understand why you can’t loop through all the tiles when a tile has been moved, check the board tile the centre point of the tile is in and compare their 2 ids.
I’m suggesting the point check and not collision because if the tiles are tightly placed together, there is the possibility that a tile also collides with an adjacent board tile.
I don’t know how to loop “through” all
I know repeat event certain times
I use collision overlapping not touching
I still don’t get it, how to do that?
oh I’ve tried repeat for each object, didn’t work
It does (the collision check makes sure of that), but you should change the order of the conditions. Get the objects first, then the specifics of the objects
Ok, I’m scratching my head a bit now. If you’re comfortable with it, would you mind zipping your project and linking to it on a shared drive so I can download it and check it out? You can PM me if you’re not fond of making it publicly available.
I think I got it , thx so much, every day I learn something
so I have to start scene with condition of wining is true to trigger the condition of making it false
You change the condition of winning to true every time before you check if there are any conditions that make it false. Otherwise the it doesn’t get reset the after it gets set to false.