Compare commits

...

4 commits

Author SHA1 Message Date
array-in-a-matrix 5b506e4bdf camera centered on player 2023-09-26 21:29:40 -04:00
array-in-a-matrix d0e7ddfc17 moved scene to scene directory 2023-09-26 21:27:02 -04:00
array-in-a-matrix 5fd31e4397 basic scene 2023-09-26 21:26:00 -04:00
array-in-a-matrix 0a530019b3 created basic player char with movement 2023-09-26 21:25:45 -04:00
5 changed files with 71 additions and 0 deletions

15
player/player.gd Normal file
View file

@ -0,0 +1,15 @@
extends CharacterBody2D
func _physics_process(delta):
velocity = Vector2()
if Input.is_key_pressed(KEY_A):
velocity.x -= 1
if Input.is_key_pressed(KEY_W):
velocity.y -= 1
if Input.is_key_pressed(KEY_S):
velocity.y += 1
if Input.is_key_pressed(KEY_D):
velocity.x += 1
velocity *= 300
move_and_slide()

BIN
player/test-player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://crm0rryg1syha"
path="res://.godot/imported/test-player.png-25c888ef9d4112280cac988679c724f1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player/test-player.png"
dest_files=["res://.godot/imported/test-player.png-25c888ef9d4112280cac988679c724f1.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

View file

@ -11,6 +11,7 @@ config_version=5
[application]
config/name="libregamefest"
run/main_scene="res://scene/node_2d.tscn"
config/features=PackedStringArray("4.1", "Mobile")
config/icon="res://icon.svg"

21
scene/node_2d.tscn Normal file
View file

@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://octr5yng0fvm"]
[ext_resource type="Script" path="res://player/player.gd" id="1_3h05o"]
[ext_resource type="Texture2D" uid="uid://crm0rryg1syha" path="res://player/test-player.png" id="2_nvejd"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4f40j"]
size = Vector2(100, 100)
[node name="Node2D" type="Node2D"]
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
script = ExtResource("1_3h05o")
[node name="Sprite2D" type="Sprite2D" parent="CharacterBody2D"]
texture_filter = 1
texture = ExtResource("2_nvejd")
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
shape = SubResource("RectangleShape2D_4f40j")
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]