Increased Gravity
This commit is contained in:
		
							parent
							
								
									1b6bbf8444
								
							
						
					
					
						commit
						deb90c26ba
					
				| 
						 | 
					@ -131,6 +131,6 @@ export default class PlayerController extends StateMachineAI {
 | 
				
			||||||
		} else if(this.currentState instanceof Fall){
 | 
							} else if(this.currentState instanceof Fall){
 | 
				
			||||||
            Debug.log("playerstate", "Player State: Fall");
 | 
					            Debug.log("playerstate", "Player State: Fall");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        Debug.log("playerspeed", "x: " + this.velocity.x + ", y:" + this.velocity.y);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,7 @@ export default class OnGround extends PlayerState {
 | 
				
			||||||
		// If we jump, move to the Jump state, give a burst of upwards velocity
 | 
							// If we jump, move to the Jump state, give a burst of upwards velocity
 | 
				
			||||||
		if(Input.isJustPressed("jump")){
 | 
							if(Input.isJustPressed("jump")){
 | 
				
			||||||
			this.finished("jump");
 | 
								this.finished("jump");
 | 
				
			||||||
			this.parent.velocity.y = -500;
 | 
								this.parent.velocity.y = -600;	// basically jump height
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
		} else if(!this.owner.onGround){
 | 
							} else if(!this.owner.onGround){
 | 
				
			||||||
			this.finished("fall");
 | 
								this.finished("fall");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@ import PlayerController from "../PlayerController";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default abstract class PlayerState extends State {
 | 
					export default abstract class PlayerState extends State {
 | 
				
			||||||
	owner: GameNode;
 | 
						owner: GameNode;
 | 
				
			||||||
	gravity: number = 1000; //TODO - can change later
 | 
						gravity: number = 1500; //TODO - can change later
 | 
				
			||||||
	parent: PlayerController;
 | 
						parent: PlayerController;
 | 
				
			||||||
	positionTimer: Timer;
 | 
						positionTimer: Timer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user