Browse Source

restructure folders

pull/1/head
Joseph Surin 3 years ago
parent
commit
c4dc5ea10d
  1. 1
      .gitignore
  2. 6
      Scenes/MainScene.tscn
  3. 20
      Scenes/Player.tscn
  4. 0
      Scenes/UI.tscn
  5. 2
      Scenes/backroom.tscn
  6. 0
      Scenes/limbo.tres
  7. 2
      Scenes/limbo.tscn
  8. 0
      Scenes/lodge.tres
  9. 30
      Scripts/Player.gd
  10. 2
      project.godot
  11. BIN
      richal/front.png
  12. 35
      richal/front.png.import

1
.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
.import

6
MainScene.tscn → Scenes/MainScene.tscn

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=2]
[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]
[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]
[node name="LivingRoom" type="Node2D"]
position = Vector2( 60, 0 )

20
Player.tscn → Scenes/Player.tscn

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
[gd_scene load_steps=16 format=2]
[ext_resource path="res://Player.gd" type="Script" id=1]
[ext_resource path="res://Scripts/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,14 +16,9 @@ @@ -16,14 +16,9 @@
[sub_resource type="SpriteFrames" id=2]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 6 ), ExtResource( 2 ), ExtResource( 7 ) ],
"loop": true,
"name": "MoveDown",
"speed": 5.0
}, {
"frames": [ ExtResource( 4 ), ExtResource( 13 ), ExtResource( 4 ), ExtResource( 8 ) ],
"frames": [ ExtResource( 4 ) ],
"loop": true,
"name": "MoveLeft",
"name": "IdleLeft",
"speed": 5.0
}, {
"frames": [ ExtResource( 5 ), ExtResource( 14 ), ExtResource( 5 ), ExtResource( 15 ) ],
@ -36,9 +31,14 @@ animations = [ { @@ -36,9 +31,14 @@ animations = [ {
"name": "MoveRight",
"speed": 5.0
}, {
"frames": [ ExtResource( 4 ) ],
"frames": [ ExtResource( 4 ), ExtResource( 13 ), ExtResource( 4 ), ExtResource( 8 ) ],
"loop": true,
"name": "IdleLeft",
"name": "MoveLeft",
"speed": 5.0
}, {
"frames": [ ExtResource( 2 ), ExtResource( 6 ), ExtResource( 2 ), ExtResource( 7 ) ],
"loop": true,
"name": "MoveDown",
"speed": 5.0
}, {
"frames": [ ExtResource( 3 ) ],

0
UI.tscn → Scenes/UI.tscn

2
backroom.tscn → Scenes/backroom.tscn

@ -1,7 +1,7 @@ @@ -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://Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=2]
[sub_resource type="TileSet" id=1]
0/name = "backroom.png 0"

0
limbo.tres → Scenes/limbo.tres

2
limbo.tscn → Scenes/limbo.tscn

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://limbo.tres" type="TileSet" id=1]
[ext_resource path="res://Scenes/limbo.tres" type="TileSet" id=1]
[node name="Node2D" type="Node2D"]

0
lodge.tres → Scenes/lodge.tres

30
Player.gd → Scripts/Player.gd

@ -1,44 +1,28 @@ @@ -1,44 +1,28 @@
extends KinematicBody2D
# 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 moveSpeed : int = 140
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
@ -71,7 +55,3 @@ func manage_animations (): @@ -71,7 +55,3 @@ 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

2
project.godot

@ -11,7 +11,7 @@ config_version=4 @@ -11,7 +11,7 @@ config_version=4
[application]
config/name="Fullhouse"
run/main_scene="res://MainScene.tscn"
run/main_scene="res://Scenes/MainScene.tscn"
config/icon="res://icon.png"
[input]

BIN
richal/front.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

35
richal/front.png.import

@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/front.png-43294f7d19ca1e0c5e3086461b9d7234.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://richal/front.png"
dest_files=[ "res://.import/front.png-43294f7d19ca1e0c5e3086461b9d7234.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Loading…
Cancel
Save