Question for firemaplegame : Snap to grid demo
beaudoin_n
Member Posts: 184
Hi Joe,
Thanks for your demo, i have a question however
How would you go about having several objects not being able to be set on top of each other... right now if i add other balls on the left they will behave correcty until i drag one on top of the other.. they then become 1 inseperable object
What would be the best way to actually skip over the objects (ie instead of moving to one right, it will move to 2 right becsause 1 is occupied)...
Or simply prevent overlapping, but that could be tricky because it would limit the user too much...
Thanks for your advice.. Meanwhile i'll try on my own to see if i can get anything done.
Thanks
Thanks for your demo, i have a question however
How would you go about having several objects not being able to be set on top of each other... right now if i add other balls on the left they will behave correcty until i drag one on top of the other.. they then become 1 inseperable object
What would be the best way to actually skip over the objects (ie instead of moving to one right, it will move to 2 right becsause 1 is occupied)...
Or simply prevent overlapping, but that could be tricky because it would limit the user too much...
Thanks for your advice.. Meanwhile i'll try on my own to see if i can get anything done.
Thanks
Comments
yeah, that's going to be a little rough with gameSalad...
first, you would need to keep track of every single grid intersection as global game attributes, the would all be booleans like this: point_1_occupied,point_2_occupied,point_3_occupied...etc..
If you just have a few points, it might be manageable, but you can see how miserable that is...
When you drop an actor, switch the appropriate attribute to TRUE.
Then you would have to constantly check whether that point is occupied, and if it isn't allow the player to drop a new actor in that spot.
Another "feature" of GameSalad is the ability to click on every single object that is under the cursor at once. Which is why in your above example, the two actors move as a unit. For example if you had a deck of cards on the stage, and you click on the top card, EVERY card gets clicked on.
It definitely takes some creativity to get around that one...
You COULD try to use "When actor collides or overlaps another actor" don't allow a new to be dropped, but you would have to test it out. it would be easier than keeping track of all the points... but I'm not sure off the top of my head if it would work or not...
Joe
But that was before 0.8, I haven't tested it on the new version yet
was so hopeful for a second...
Anyways let me see this through...
I set 9 global vars to tell if my position is occupied or not
then whenever i release a ball i will try and figure out where i am and attribute the global var to occupied.
then if i want to release somewhere where it is occupied i'll return the ball to the left of the screen ?
Sounds right ?
Looks like it can work with just the collide/overlap...
I'll keep you posted
and update to the latest version. they won't be going back to 0.7.
0.82 is way faster, especially on older devices.
and when you publish a game, they will return a 0.82 app to you anyway.
When target value = my value set global= correct =1
when click confirm choice and global.correct = 9 then hurray otherwise let them know how many errors ?
I'll update...crossing my fingers
I am trying to setup the grid in the middle of the play area, I managed to constraint the objects but depending on where i move from it seems i always get an extra column/row
I set up a minX maxX minY maxY for the constraint rule
I end up with a 4X4 instead of a 3X3
Thanks