side-scroller

How can I make an infinite side scrolling background in Phaserjs?

↘锁芯ラ 提交于 2019-12-03 18:57:37
问题 I'm using phaser.js to make a game and I cannot find any tutorials on how to make the background scroll infinitely. I'd like the background to tile/repeat sideways, and infinitely as the character moves right. I am currently using a camera and having the camera follow the character. Here's my idea about how to do this: Check the position of the camera constantly in update() , and then move it to the beginning of gameplay (the very left) along with the character at that time. I think that this

How can I make an infinite side scrolling background in Phaserjs?

孤者浪人 提交于 2019-11-30 03:08:58
I'm using phaser.js to make a game and I cannot find any tutorials on how to make the background scroll infinitely. I'd like the background to tile/repeat sideways, and infinitely as the character moves right. I am currently using a camera and having the camera follow the character. Here's my idea about how to do this: Check the position of the camera constantly in update() , and then move it to the beginning of gameplay (the very left) along with the character at that time. I think that this would probably not be a smooth transition though, so I'm wondering if there is a better way to do it.

2D side scrolling camera view in html5

纵饮孤独 提交于 2019-11-30 00:31:11
I was wondering how I could go about making a camera-like view where I could scroll a level within a canvas element just like this: http://playbiolab.com/ So you want a 500x500 canvas to display something (a game level) that is really 9000x500 or so. This is fine. What you do is think of the canvas as a "viewport" for a larger scene. You translate the canvas (or everything else) to the appropriate spot and draw all of the relevant things at that spot. Here's an example: http://jsfiddle.net/hKrrY/ Click on the canvas and hold down your left arrow key to see the scene go by while the red player

2D side scrolling camera view in html5

╄→尐↘猪︶ㄣ 提交于 2019-11-28 21:26:59
问题 I was wondering how I could go about making a camera-like view where I could scroll a level within a canvas element just like this: http://playbiolab.com/ 回答1: So you want a 500x500 canvas to display something (a game level) that is really 9000x500 or so. This is fine. What you do is think of the canvas as a "viewport" for a larger scene. You translate the canvas (or everything else) to the appropriate spot and draw all of the relevant things at that spot. Here's an example: http://jsfiddle