Grid Size Not matching up to background
NY415
Member Posts: 25
I've been able to figure out how to make it a swipe to move one box in the grid. Now I'm having the trouble of aligning the grid to the background. Any thoughts on how to do this?
I constrained the character to
self.position.x to: (self.COL)*(game.squaresize)+(game.paddingside)*(game.squaresize)
self.position.y to: (self.ROW)*(game.squaresize)+(game.paddingtopbot)*(game.squaresize)
I followed this from the linked guide. I changed the side padding to be a different attribute from the top/bot padding thinking it would help, but I'm not able to get the character movements to match the background grid. Any help would be great!
I constrained the character to
self.position.x to: (self.COL)*(game.squaresize)+(game.paddingside)*(game.squaresize)
self.position.y to: (self.ROW)*(game.squaresize)+(game.paddingtopbot)*(game.squaresize)
I followed this from the linked guide. I changed the side padding to be a different attribute from the top/bot padding thinking it would help, but I'm not able to get the character movements to match the background grid. Any help would be great!
Comments
My guess is that your actors are off by a factor of game.squaresize divided by 2. Is that accurate? Can you post a screenshot of what your scene looks like when previewed?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://imgur.com/a/vQ8BM
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'm not entirely sure what the actual dimensions of the background grid is. What is the best way to measure?
Sorry I'm very new to this
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The problem is with the position of your background image.
If you look at the screenshot below, I added a red line at y=240 and moved the character actor to row 2 (y=240). Your grid squares need to be aligned so that the y position (center of the square) is at y=240. They are currently aligned at about y=228 (see the yellow square).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Constrain attribute self.position.y to: (self.ROW)*(game.squaresize)+(game.paddingtopbot)*(game.squaresize)-12
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User