Compare commits
3 Commits
4fcf2a45fd
...
0000f640b1
| Author | SHA1 | Date | |
|---|---|---|---|
| 0000f640b1 | |||
| 2f5f9f0127 | |||
| 0a6418c532 |
BIN
Tiles/Inner.png
Normal file
BIN
Tiles/Inner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
Tiles/Overworld.png
Normal file
BIN
Tiles/Overworld.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
BIN
Tiles/cave.png
Normal file
BIN
Tiles/cave.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
Tiles/objects.png
Normal file
BIN
Tiles/objects.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
assets/birb-flying-Sheet.png
Normal file
BIN
assets/birb-flying-Sheet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
34
assets/birb-flying-Sheet.png.import
Normal file
34
assets/birb-flying-Sheet.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b0rk3rui1igny"
|
||||
path="res://.godot/imported/birb-flying-Sheet.png-eb573f03df7e64c9177a6cb2103806e5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/birb-flying-Sheet.png"
|
||||
dest_files=["res://.godot/imported/birb-flying-Sheet.png-eb573f03df7e64c9177a6cb2103806e5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
assets/birb-flying.aseprite
Normal file
BIN
assets/birb-flying.aseprite
Normal file
Binary file not shown.
BIN
birb-flying.aseprite
Normal file
BIN
birb-flying.aseprite
Normal file
Binary file not shown.
34
main character.gd
Normal file
34
main character.gd
Normal file
@ -0,0 +1,34 @@
|
||||
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