-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
116 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# See: https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_styleguide.html#formatting | ||
[*.gd] | ||
indent_style = tab | ||
|
||
[*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Continuous Integration (CI) | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
static-checks: | ||
name: Static checks | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4.1.1 | ||
- uses: Scony/godot-gdscript-toolkit@4.2.2 | ||
with: | ||
version: 3.5.0 | ||
- run: gdformat --check scenes/ | ||
- run: gdlint scenes/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Godot (https://github.com/github/gitignore/blob/main/Godot.gitignore) | ||
# Godot 4+ specific ignores | ||
.godot/ | ||
|
||
# Godot-specific ignores | ||
.import/ | ||
export.cfg | ||
export_presets.cfg | ||
|
||
# Imported translations (automatically generated from CSV files) | ||
*.translation | ||
|
||
# Mono-specific ignores | ||
.mono/ | ||
data_*/ | ||
mono_crash.*.json | ||
|
||
# Project-specific files & folders to ignore | ||
|
||
## Python virtual environment (contains gdtoolkit & pre-commit) | ||
.env/ | ||
.venv/ | ||
env/ | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: trailing-whitespace |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gdtoolkit==3.5.0 | ||
pre-commit==3.6.2 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=1] | ||
|
||
[node name="Level1" type="Node2D"] | ||
|
||
[node name="Player" parent="." instance=ExtResource( 1 )] | ||
position = Vector2( 144, 52 ) | ||
collision_layer = 3 | ||
collision_mask = 3 | ||
speed = 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://assets/dead.jpg" type="Texture" id=1] | ||
|
||
[node name="LoseScreen" type="Node2D"] | ||
|
||
[node name="Sprite" type="Sprite" parent="."] | ||
position = Vector2( 512, 320 ) | ||
scale = Vector2( 0.76, 0.76 ) | ||
texture = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
extends KinematicBody2D | ||
|
||
export (int) var speed = 400 | ||
export (int) var GRAVITY = 1200 | ||
export (int) var jump_speed = -400 | ||
const UP = Vector2(0, -1) | ||
|
||
const UP = Vector2(0,-1) | ||
export var speed: int = 400 | ||
export var GRAVITY: int = 1200 | ||
export var jump_speed: int = -400 | ||
|
||
var velocity = Vector2() | ||
var velocity: Vector2 = Vector2() | ||
|
||
onready var animator = self.get_node("Animator") | ||
onready var sprite = self.get_node("Sprite") | ||
|
||
func get_input(): | ||
velocity.x = 0 | ||
if is_on_floor() and Input.is_action_just_pressed('jump'): | ||
if is_on_floor() and Input.is_action_just_pressed("jump"): | ||
velocity.y = jump_speed | ||
if Input.is_action_pressed('right'): | ||
if Input.is_action_pressed("right"): | ||
velocity.x += speed | ||
if Input.is_action_pressed('left'): | ||
if Input.is_action_pressed("left"): | ||
velocity.x -= speed | ||
|
||
func _physics_process(delta): | ||
|
||
func _physics_process(_delta): | ||
velocity.y += delta * GRAVITY | ||
get_input() | ||
velocity = move_and_slide(velocity, UP) | ||
|
||
func _process(delta): | ||
|
||
func _process(_delta): | ||
if velocity.y != 0: | ||
animator.play("Jump") | ||
$Animator.play("Jump") | ||
elif velocity.x != 0: | ||
animator.play("Walk") | ||
$Animator.play("Walk") | ||
if velocity.x > 0: | ||
sprite.flip_h = false | ||
$Sprite.flip_h = false | ||
else: | ||
sprite.flip_h = true | ||
$Sprite.flip_h = true | ||
else: | ||
animator.play("Idle") | ||
|
||
$Animator.play("Idle") |
Oops, something went wrong.