Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var player = ig.game.getEntityByName('player');
- this.screen.x = player.pos.x - ig.system.width / 2 + player.size.x / 2;
- this.screen.y = player.pos.y - ig.system.height / 2 + player.size.y / 2;
- if (this.screen.x < 0) {
- this.screen.x = 0;
- }
- if (this.screen.x > 1280 - 480) {
- this.screen.x = 1280 - 480;
- }
- if (this.screen.y < 0) {
- this.screen.y = 0;
- }
- if (this.screen.y > 800 - 320) {
- this.screen.y = 800- 320;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement