Skip to content

Commit

Permalink
fixed mouse drifting
Browse files Browse the repository at this point in the history
  • Loading branch information
tanema committed Oct 25, 2011
1 parent 52ff31c commit 2b7bca9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/game.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/tile_engine/keyboard.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/tile_engine/mouse.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion js/tile_engine/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function newView(x, y, width, height, mapWidth, mapHeight, renderCircular){
view.x = view.x+(view.main_sprite.x - (view.x + width/2)) * 0.05
view.y = view.y+(view.main_sprite.y - (view.y + height/2)) * 0.05
if(renderCircular){
if((view.x + width) >= mapWidth+mapWidth){
if((view.x + width) >= mapWidth+mapWidth-1){
view.x = 0;
view.main_sprite.setXY( view.main_sprite.x - mapWidth, view.main_sprite.y)
}else if(view.x <= -mapWidth){
Expand Down Expand Up @@ -51,6 +51,7 @@ function newView(x, y, width, height, mapWidth, mapHeight, renderCircular){
}
}
}

view.viewWidth = view.x + width;
view.viewHeight = view.y + height;
},
Expand Down

0 comments on commit 2b7bca9

Please sign in to comment.