Don't snap things to grid when not falling/stopped. This should hopefully fix the problem where things end up off the grid or out of line.

This commit is contained in:
Rob Pearce 2016-08-26 10:31:09 +10:00
parent 19f5ded391
commit 48996e701f
2 changed files with 9 additions and 0 deletions

View File

@ -4104,6 +4104,11 @@ function thing(gridx, gridy, type, text) {
var moved = false; var moved = false;
var snaptox = Math.floor(this.gridx * GRIDSIZE + (GRIDSIZE/2) - (this.size/2)); var snaptox = Math.floor(this.gridx * GRIDSIZE + (GRIDSIZE/2) - (this.size/2));
var snaptoy = Math.floor(this.gridy * GRIDSIZE + (GRIDSIZE/2) - (this.size/2)); var snaptoy = Math.floor(this.gridy * GRIDSIZE + (GRIDSIZE/2) - (this.size/2));
if (this.state != "fall" && this.state != "stop") {
return false;
}
//var snapto = (GRIDSIZE + (GRIDSIZE/2) - (THINGSIZE/2); //var snapto = (GRIDSIZE + (GRIDSIZE/2) - (THINGSIZE/2);
//if (this.y % (GRIDSIZE + (GRIDSIZE/2) - (THINGSIZE/2)) != 0) { //if (this.y % (GRIDSIZE + (GRIDSIZE/2) - (THINGSIZE/2)) != 0) {
//if (this.y % snapto != 0) { //if (this.y % snapto != 0) {

4
todo
View File

@ -55,6 +55,10 @@ show total points on path ??
when a parade is going in to a door, they seem to disappear at the wrong place when a parade is going in to a door, they seem to disappear at the wrong place
... try slowing them down ... try slowing them down
thing added at top with x = -1 !!!! thing added at top with x = -1 !!!!
it's probably cause of x snap.
don't snap when in something other than fall/stop
fixed now???????
--------------- ---------------