Movement Problem
I've got a problem . . . . .
. . . and was hoping the mighty collective brain of the forum might have some useful input.
..............................................
I have an actor which I want to move left by 32 pixels and up by 19 pixels every 1 second.
..............................................
Here's the code for the actor:

..............................................
Here is his starting position (zoomed in so you can see the pixels)
The red diamond is perfectly aligned with the diamond grid - the actor is sitting on whole number co-ordinates, the grid is sitting on whole number co-ordinates.

Now here is what happens when he starts to move, he drifts a pixel to the left and a pixel down, so he ends up off centre:

..............................................
It's important for what I am trying to do that I can get this actor to move by -32 pixels and +19 pixels, I have been fighting this issue all day, I stripped my project down to just these two elements (the grid and the diamond) and I am still stuck with this problem !
(
The only insight I can offer is that when you try the same move with an actor generated in GS (ie: a box with no image) using the very same rules (in fact using the same project file) it sticks to the grid perfectly.
Here's the project file I am struggling with:
http://www.mediafire.com/?6z4i1d97pbplz6t
Here is the very same project code except using only a GS actor (with no image) as a guide/marker to see if it drifts out of sync (it doesn't):
http://www.mediafire.com/?cg5glwfivg2l42z
..............................................
Any help or ideas how to get around this greatly appreciated, I know it's only a couple of pixels, but it defeats what I am trying to do !!
Cheers
Tynan.
. . . and was hoping the mighty collective brain of the forum might have some useful input.
..............................................
I have an actor which I want to move left by 32 pixels and up by 19 pixels every 1 second.
..............................................
Here's the code for the actor:

..............................................
Here is his starting position (zoomed in so you can see the pixels)
The red diamond is perfectly aligned with the diamond grid - the actor is sitting on whole number co-ordinates, the grid is sitting on whole number co-ordinates.

Now here is what happens when he starts to move, he drifts a pixel to the left and a pixel down, so he ends up off centre:

..............................................
It's important for what I am trying to do that I can get this actor to move by -32 pixels and +19 pixels, I have been fighting this issue all day, I stripped my project down to just these two elements (the grid and the diamond) and I am still stuck with this problem !

The only insight I can offer is that when you try the same move with an actor generated in GS (ie: a box with no image) using the very same rules (in fact using the same project file) it sticks to the grid perfectly.
Here's the project file I am struggling with:
http://www.mediafire.com/?6z4i1d97pbplz6t
Here is the very same project code except using only a GS actor (with no image) as a guide/marker to see if it drifts out of sync (it doesn't):
http://www.mediafire.com/?cg5glwfivg2l42z
..............................................
Any help or ideas how to get around this greatly appreciated, I know it's only a couple of pixels, but it defeats what I am trying to do !!
Cheers
Tynan.
Comments
The red diamond instead of sticking to the grid - by moving 32 pixels left and 19 pixels up - ends up out of sync with the grid by a couple of pixels after a while.
It's got me stumped !!?? 8-X 8-X 8-X 8-X
?
? Have I understood your suggestion right ?
Cheers for the input.
Cheers for any help, it's genuinely appreciated.
If you zoom in on your Mac using ctrl+scroll wheel up (make sure you have 'smooth images switched off in the universal access systems preferences so you can see GS's actual pixels) . . . . and you follow the actor up and across the screen, you can actually see it move to the correct position and then (in a fraction of a second) jump down a pixel ! It's as if once it arrives at the correct locations (-32 across and 19 up) something tells it to jump down a pixel ?
Well, kind of solved, I always think solved should mean you have worked out why it's not working and you have fixed it . . . but I've got it to work as it should but have no clue why it wouldn't work before nor why or how the solution works !!!?!
Taking a lead from JohnPapiomitis' suggestion I added +0.1 to the X and Y value . . . . as the actor was drifting down and left by 1 whole pixel I added a +0.1 pixel value in the opposite direction, not enough to move the starting point out of alignment but seemingly enough to stop the actor drifting the other way.
Just another little GameSalad idiosyncrasy I guess !
Cheers to everyone, much appreciated, sometimes a day's frustration and testing can be solved by even a few hints and nudges from other people.
Would tables be a better way to move stuff around a grid ? I'll stick a screen shot up so you can see what I am trying to do . . .
Cheers ! That would be brilliant !
I will PM you a rough project so you can see what angles / numbers I am using . . . . !
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
For me the weirdest thing is that dumping the image (just using a blank actor / flat coloured box) solves the problem ?
http://www.mediafire.com/?cg5glwfivg2l42z
Interpolation exhibits the same problem, although a little different as it seems to jump back into sync every few iterations, but essentially it's the same deal.
In my first post in this thread there is the example file (the troubled actor version) - and in the actor is a display text behaviour, if you switch it on it will happily show you nice even integers for 20 or so iterations . . but if you look at the actual actor it is out of sync after 2 or 3 moves.