fix: view port should track player
This commit is contained in:
		
							parent
							
								
									ecf14b4073
								
							
						
					
					
						commit
						63bb9c3d79
					
				| 
						 | 
					@ -26,6 +26,7 @@ export default class Tutorial extends GameLevel{
 | 
				
			||||||
        // Add the level 1 tilemap
 | 
					        // Add the level 1 tilemap
 | 
				
			||||||
        this.add.tilemap("forest1", new Vec2(2, 2));
 | 
					        this.add.tilemap("forest1", new Vec2(2, 2));
 | 
				
			||||||
        this.viewport.setBounds(0, 0, this.map.width*32, this.map.height*32);
 | 
					        this.viewport.setBounds(0, 0, this.map.width*32, this.map.height*32);
 | 
				
			||||||
 | 
					        this.viewport.follow(this.player);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.playerSpawn = new Vec2(5*32, 9*32);
 | 
					        this.playerSpawn = new Vec2(5*32, 9*32);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user