dchhetri Posted January 12, 2014 Share Posted January 12, 2014 Here is the demo: http://99.113.170.121/hobo2/ That link will only be active for a little while. If you run it, and try to move the character to the right, the character stops moving even though its position is increasing. Anyone have a solution to this? The code to setup the camera is at link 487 in app.js regards, D.Chhetri Link to comment Share on other sites More sharing options...
jerome Posted January 12, 2014 Share Posted January 12, 2014 Ip addresses 192.168.x.y aren't accessible to others in Internet, your address is just a local address Link to comment Share on other sites More sharing options...
jpdev Posted January 12, 2014 Share Posted January 12, 2014 Without seeing the source (because you linked to a local network IP) I am taking a guess: If you set the camera to follow a sprite, the sprite itself will only move if it's near the edges of the game world.If it reaches half the view-port of the camera, it will stop to move and now the camera will move instead. For example: if you run to the very left in a mario level, the mario sprite will be able to reach the left of the screen.Now you run to the right, the mario sprite will move, until it's in the center of the screen. It will then be stuck there and now the camera will move instead (so the level under the sprite moves on screen.) In the game world, the x position of mario changes, but not on screen, because the camera ist following him. Hope that helps - if not, please publish your game somewhere online, so we can check it out.(Since phaser does not require serverside code you can use basically any free webhoster to do that.) Link to comment Share on other sites More sharing options...
dchhetri Posted January 12, 2014 Author Share Posted January 12, 2014 Sorry about that. I've got port 80 forwarding on. So you guys should be able to hit it outside my network. I just have my computer off right now so you won't be able to check it out. I'll update this in a few hour when I get home so you guys can check it out. Thanks Link to comment Share on other sites More sharing options...
dchhetri Posted January 13, 2014 Author Share Posted January 13, 2014 Ok the site should be up, can someone at least verify that the above url works? Link to comment Share on other sites More sharing options...
XekeDeath Posted January 13, 2014 Share Posted January 13, 2014 We would need your external IP address, as 192.168.*.* addresses are internal network addresses. You can get that from sites like http://www.whatsmyip.org/. Link to comment Share on other sites More sharing options...
dchhetri Posted January 13, 2014 Author Share Posted January 13, 2014 Thanks. Updated public ip: http://99.113.170.121 Link to comment Share on other sites More sharing options...
BitlasLT Posted January 13, 2014 Share Posted January 13, 2014 IF possible, can you attach all source code with arts? Link to comment Share on other sites More sharing options...
jpdev Posted January 13, 2014 Share Posted January 13, 2014 Just confirming, that your port forwared did work, and that the bug (suck after moving to the right for a while) does happen. (I used chrome) I did not have the time to debug anything, since I had to leave for work. Right now it seems to be offline. Link to comment Share on other sites More sharing options...
dchhetri Posted January 13, 2014 Author Share Posted January 13, 2014 Thanks jpdev, it should be online for now. Hopefully someone can help with the issue. Thanks. Link to comment Share on other sites More sharing options...
jpdev Posted January 13, 2014 Share Posted January 13, 2014 hi dchhetri, The Link (updated public ip) is not working.It's possible that you are offline again, it's also possible, that you have a dynamic ip adress (this would mean it changes everytime you go online and/or every 24h hours at the daily disconnect). It would be easier if you upload your game in it's current state to your github and link it here. Link to comment Share on other sites More sharing options...
dchhetri Posted January 13, 2014 Author Share Posted January 13, 2014 Yes you're right, current public ip is: http://99.113.170.121 . I'll work on getting it up online somewhere more reliable. Link to comment Share on other sites More sharing options...
jpdev Posted January 13, 2014 Share Posted January 13, 2014 Hi dchetri, I did the following to get it to work correctly: All in file app.js: Around Line 475: Your lines (remove them): //this.nonWalkableLayer.fixedToCamera = false; //this.walkableLayer.fixedToCamera = false; My lines (add this in their place): this.walkableLayer.resizeWorld(); this.nonWalkableLayer.fixedToCamera = true; this.walkableLayer.fixedToCamera = true; Around Line 493: Your lines (remove them): if(keyboard.isDown(Phaser.Keyboard.W)){this.game.camera.y -= speed;} else if(keyboard.isDown(Phaser.Keyboard.S)){this.game.camera.y += speed;} else if(keyboard.isDown(Phaser.Keyboard.A)){this.game.camera.x -= speed;} else if(keyboard.isDown(Phaser.Keyboard.D)){this.game.camera.x += speed;} My lines: none, just remove your four lines Result: You can now walk around the whole map freely. Hope that helped.. if you don't mind, click 'like this' on the posts that helped, thanks dchhetri 1 Link to comment Share on other sites More sharing options...
dchhetri Posted January 13, 2014 Author Share Posted January 13, 2014 Would you mind explaining why this.walkableLayer.resizeWorld(); this.nonWalkableLayer.fixedToCamera = true; this.walkableLayer.fixedToCamera = true; fixes the issue. Link to comment Share on other sites More sharing options...
jpdev Posted January 14, 2014 Share Posted January 14, 2014 "this.walkableLayer.resizeWorld();" might be the really important change here.I think Your World was too small for the layer, so you everything got stuck at the world border. But I must admit that this is only a guess, since I just looked at the code and compared it to my working tileset code - tried this as a first change to your code, and when it worked I did not look into it further Link to comment Share on other sites More sharing options...
Recommended Posts