Compare commits
	
		
			1 Commits
		
	
	
		
			0000f640b1
			...
			4fcf2a45fd
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 4fcf2a45fd | 
							
								
								
									
										
											BIN
										
									
								
								Tiles/Inner.png
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tiles/Inner.png
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 18 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 98 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Tiles/cave.png
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Tiles/cave.png
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 14 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 24 KiB  | 
@ -1,34 +0,0 @@
 | 
				
			|||||||
extends CharacterBody2D
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const SPEED = 100.0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func _physics_process(delta: float) -> void:
 | 
					 | 
				
			||||||
	var direction := Input.get_axis("left", "right")
 | 
					 | 
				
			||||||
	var updownDirection:=Input.get_axis("up","down")
 | 
					 | 
				
			||||||
	if direction:
 | 
					 | 
				
			||||||
		velocity.x = direction * SPEED
 | 
					 | 
				
			||||||
	else:
 | 
					 | 
				
			||||||
		velocity.x = move_toward(velocity.x, 0, SPEED)
 | 
					 | 
				
			||||||
	if updownDirection:
 | 
					 | 
				
			||||||
		velocity.y = updownDirection *SPEED
 | 
					 | 
				
			||||||
	else:
 | 
					 | 
				
			||||||
		velocity.y = move_toward(velocity.y,0,SPEED)
 | 
					 | 
				
			||||||
	animation(direction,updownDirection)
 | 
					 | 
				
			||||||
	move_and_slide()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func animation(directionX,directionY):
 | 
					 | 
				
			||||||
	if directionX == 0 and directionY == 0:
 | 
					 | 
				
			||||||
		$"AnimatedSprite2D".set_frame(0)
 | 
					 | 
				
			||||||
		$"AnimatedSprite2D".pause()
 | 
					 | 
				
			||||||
	if directionX < 0:
 | 
					 | 
				
			||||||
		$"AnimatedSprite2D".play("WalkLeft")
 | 
					 | 
				
			||||||
	elif directionX > 0:
 | 
					 | 
				
			||||||
		$"AnimatedSprite2D".play("WalkRight")
 | 
					 | 
				
			||||||
	if directionY > 0 and directionX == 0:
 | 
					 | 
				
			||||||
		$"AnimatedSprite2D".play("WalkDown")
 | 
					 | 
				
			||||||
	elif directionY < 0 and directionX ==0:
 | 
					 | 
				
			||||||
		$"AnimatedSprite2D".play("WalkUp")
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user