From 6527eee2a084af58e8290f9bdd36e8fcec191dbc Mon Sep 17 00:00:00 2001 From: Joseph Surin Date: Tue, 18 Jan 2022 00:09:04 +1100 Subject: [PATCH] Revert "restructure folders" This reverts commit c4dc5ea10d9c80957a014309e5690bbd4d507d62. --- .gitignore | 1 - Scenes/MainScene.tscn => MainScene.tscn | 6 ++-- Scripts/Player.gd => Player.gd | 30 ++++++++++++++++---- Scenes/Player.tscn => Player.tscn | 20 +++++++------- Scenes/UI.tscn => UI.tscn | 0 Scenes/backroom.tscn => backroom.tscn | 2 +- Scenes/limbo.tres => limbo.tres | 0 Scenes/limbo.tscn => limbo.tscn | 2 +- Scenes/lodge.tres => lodge.tres | 0 project.godot | 2 +- richal/front.png | Bin 0 -> 1057 bytes richal/front.png.import | 35 ++++++++++++++++++++++++ 12 files changed, 76 insertions(+), 22 deletions(-) delete mode 100644 .gitignore rename Scenes/MainScene.tscn => MainScene.tscn (93%) rename Scripts/Player.gd => Player.gd (68%) rename Scenes/Player.tscn => Player.tscn (97%) rename Scenes/UI.tscn => UI.tscn (100%) rename Scenes/backroom.tscn => backroom.tscn (99%) rename Scenes/limbo.tres => limbo.tres (100%) rename Scenes/limbo.tscn => limbo.tscn (86%) rename Scenes/lodge.tres => lodge.tres (100%) create mode 100644 richal/front.png create mode 100644 richal/front.png.import diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 37f05f2..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.import diff --git a/Scenes/MainScene.tscn b/MainScene.tscn similarity index 93% rename from Scenes/MainScene.tscn rename to MainScene.tscn index 1bbbca2..6073131 100644 --- a/Scenes/MainScene.tscn +++ b/MainScene.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=1] -[ext_resource path="res://Scenes/UI.tscn" type="PackedScene" id=2] -[ext_resource path="res://Scenes/lodge.tres" type="TileSet" id=14] +[ext_resource path="res://Player.tscn" type="PackedScene" id=1] +[ext_resource path="res://UI.tscn" type="PackedScene" id=2] +[ext_resource path="res://lodge.tres" type="TileSet" id=14] [node name="LivingRoom" type="Node2D"] position = Vector2( 60, 0 ) diff --git a/Scripts/Player.gd b/Player.gd similarity index 68% rename from Scripts/Player.gd rename to Player.gd index a415cda..179564a 100644 --- a/Scripts/Player.gd +++ b/Player.gd @@ -1,28 +1,44 @@ extends KinematicBody2D -var moveSpeed : int = 140 + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" +var curHp : int = 10 +var maxHp : int = 10 +var moveSpeed : int = 180 +var damage : int = 1 +var gold : int = 0 +var curLevel : int = 0 +var curXp : int = 0 +var xpToNextLevel : int = 50 +var xpToLevelIncreaseRate : float = 1.2 var interactDist : int = 70 var vel = Vector2() var facingDir = Vector2() onready var rayCast = $RayCast2D onready var anim = $AnimatedSprite +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + func _physics_process (delta): vel = Vector2() # inputs if Input.is_action_pressed("move_up"): - vel.y = -1 + vel.y -= 1 facingDir = Vector2(0, -1) if Input.is_action_pressed("move_down"): - vel.y = 1 + vel.y += 1 facingDir = Vector2(0, 1) if Input.is_action_pressed("move_left"): - vel.x = -1 + vel.x -= 1 facingDir = Vector2(-1, 0) if Input.is_action_pressed("move_right"): - vel.x = 1 + vel.x += 1 facingDir = Vector2(1, 0) # normalize the velocity to prevent faster diagonal movement @@ -55,3 +71,7 @@ func manage_animations (): play_animation("IdleUp") elif facingDir.y == 1: play_animation("IdleDown") + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/Scenes/Player.tscn b/Player.tscn similarity index 97% rename from Scenes/Player.tscn rename to Player.tscn index 3b3d506..1b10645 100644 --- a/Scenes/Player.tscn +++ b/Player.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=16 format=2] -[ext_resource path="res://Scripts/Player.gd" type="Script" id=1] +[ext_resource path="res://Player.gd" type="Script" id=1] [ext_resource path="res://Sprites/mc/front.png" type="Texture" id=2] [ext_resource path="res://Sprites/mc/right.png" type="Texture" id=3] [ext_resource path="res://Sprites/mc/left.png" type="Texture" id=4] @@ -16,9 +16,14 @@ [sub_resource type="SpriteFrames" id=2] animations = [ { -"frames": [ ExtResource( 4 ) ], +"frames": [ ExtResource( 2 ), ExtResource( 6 ), ExtResource( 2 ), ExtResource( 7 ) ], "loop": true, -"name": "IdleLeft", +"name": "MoveDown", +"speed": 5.0 +}, { +"frames": [ ExtResource( 4 ), ExtResource( 13 ), ExtResource( 4 ), ExtResource( 8 ) ], +"loop": true, +"name": "MoveLeft", "speed": 5.0 }, { "frames": [ ExtResource( 5 ), ExtResource( 14 ), ExtResource( 5 ), ExtResource( 15 ) ], @@ -31,14 +36,9 @@ animations = [ { "name": "MoveRight", "speed": 5.0 }, { -"frames": [ ExtResource( 4 ), ExtResource( 13 ), ExtResource( 4 ), ExtResource( 8 ) ], -"loop": true, -"name": "MoveLeft", -"speed": 5.0 -}, { -"frames": [ ExtResource( 2 ), ExtResource( 6 ), ExtResource( 2 ), ExtResource( 7 ) ], +"frames": [ ExtResource( 4 ) ], "loop": true, -"name": "MoveDown", +"name": "IdleLeft", "speed": 5.0 }, { "frames": [ ExtResource( 3 ) ], diff --git a/Scenes/UI.tscn b/UI.tscn similarity index 100% rename from Scenes/UI.tscn rename to UI.tscn diff --git a/Scenes/backroom.tscn b/backroom.tscn similarity index 99% rename from Scenes/backroom.tscn rename to backroom.tscn index bf19702..a7d7b2d 100644 --- a/Scenes/backroom.tscn +++ b/backroom.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://Tiles/backroom.png" type="Texture" id=1] -[ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://Player.tscn" type="PackedScene" id=2] [sub_resource type="TileSet" id=1] 0/name = "backroom.png 0" diff --git a/Scenes/limbo.tres b/limbo.tres similarity index 100% rename from Scenes/limbo.tres rename to limbo.tres diff --git a/Scenes/limbo.tscn b/limbo.tscn similarity index 86% rename from Scenes/limbo.tscn rename to limbo.tscn index 77c1a32..6669ca1 100644 --- a/Scenes/limbo.tscn +++ b/limbo.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://Scenes/limbo.tres" type="TileSet" id=1] +[ext_resource path="res://limbo.tres" type="TileSet" id=1] [node name="Node2D" type="Node2D"] diff --git a/Scenes/lodge.tres b/lodge.tres similarity index 100% rename from Scenes/lodge.tres rename to lodge.tres diff --git a/project.godot b/project.godot index 1bca043..3c8c698 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=4 [application] config/name="Fullhouse" -run/main_scene="res://Scenes/MainScene.tscn" +run/main_scene="res://MainScene.tscn" config/icon="res://icon.png" [input] diff --git a/richal/front.png b/richal/front.png new file mode 100644 index 0000000000000000000000000000000000000000..a050dc59219e9c5beded211f7555b29861692ee7 GIT binary patch literal 1057 zcmeAS@N?(olHy`uVBq!ia0vp^6(G#P1|%(0%q}r7Fu(A0aSW-L^Y)InM@XQ|@sEq2 zGS~2E1|@DQ6clke-EqjZ+sx5$Yr%AZ9d8ublyuVs1y#NksB>&vzi@$Xx0sNNH)oW~ zmW~NrnJG05i%qt57WW^vtXgk%_V53nbz#R}&wTy#&-4F}EB5vo0__BYknq^G`U(6w zAwT~ty1ruHHSva5iw>Of?46%=yr^Tx*G0`!7X!InbE1wGb#!c94CV$VJk{7xBoeW6 z%X^l~+lu)--&$QdcnT=`?fNgKGVSt<^?SBj-mIJ!&iuT7?i-s-XLfD(#;L;c7Z+;S zU6}M`Z}h#dTbBsRu90C4)7!d#!T-m5FFt%XXY#vglZ(o)N55GSyt}UiYW||TFE$t6 zy)3y`f4%+Z_jSwHsaC%~W_^B{<;vbvaj*$~E@wh!?FxAR-}sT@|360z{}~s|Gfypi z?Fz9}+;Zx%b#A*~KlwiYuUOb35BWO1>fRS%4=j3|uANtMT+z1686xl~In#9Z*1$Vg zuBZ1;PfL4Kv1G>gecv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