Skip to content

Commit

Permalink
start project and move player
Browse files Browse the repository at this point in the history
  • Loading branch information
201flaviosilva committed Nov 24, 2022
1 parent a6e83cf commit ec2e06a
Show file tree
Hide file tree
Showing 22 changed files with 136 additions and 399 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/Godot-Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

env:
GODOT_VERSION: 3.5.1
EXPORT_NAME: Template # Project Name
EXPORT_NAME: Snake-3D # Project Name
FOLDER_PATH: Project

jobs:
Expand Down
66 changes: 0 additions & 66 deletions .gitlab-ci.yml

This file was deleted.

28 changes: 28 additions & 0 deletions Project/Player/Player.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
extends Area2D

export (float, 0.1, 1) var normal_speed: float = 0.25

const GRID_SIZE = 64
var direction: Vector2 = Vector2.RIGHT
var speed: float = normal_speed

func _ready() -> void:
_set_speed(normal_speed)

func _process(delta: float) -> void:
if Input.is_action_just_pressed("up"): direction = Vector2.UP
if Input.is_action_just_pressed("down"): direction = Vector2.DOWN
if Input.is_action_just_pressed("left"): direction = Vector2.LEFT
if Input.is_action_just_pressed("right"): direction = Vector2.RIGHT

if Input.is_action_just_pressed("run"): _set_speed(normal_speed / 2)
elif Input.is_action_just_released("run"): _set_speed(normal_speed)

func _on_Move_timeout() -> void:
global_position += direction * GRID_SIZE

func _set_speed(value: float) -> void:
var move_timer = $Move
speed = value
move_timer.wait_time = speed
move_timer.start()
23 changes: 23 additions & 0 deletions Project/Player/Player.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://icon.png" type="Texture" id=1]
[ext_resource path="res://Player/Player.gd" type="Script" id=2]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 29, 29 )

[node name="Player" type="Area2D"]
script = ExtResource( 2 )

[node name="Sprite" type="Sprite" parent="."]
rotation = 1.5708
texture = ExtResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )

[node name="Move" type="Timer" parent="."]
wait_time = 0.25
autostart = true

[connection signal="timeout" from="Move" to="." method="_on_Move_timeout"]
13 changes: 13 additions & 0 deletions Project/Scenes/Game2D.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]

[node name="Game2D" type="Node2D"]

[node name="Background" type="ColorRect" parent="."]
margin_right = 1280.0
margin_bottom = 720.0
color = Color( 0, 0.741176, 0.239216, 1 )

[node name="Player" parent="." instance=ExtResource( 1 )]
position = Vector2( 672, 384 )
24 changes: 19 additions & 5 deletions Project/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../_Build/Windows/Template.exe"
export_path="../_Build/Windows/Snake 3D.exe"
script_export_mode=1
script_encryption_key=""

Expand All @@ -58,13 +58,15 @@ texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
codesign/enable=false
codesign/identity_type=0
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/modify_resources=false
application/icon=""
application/file_version=""
application/product_version=""
Expand All @@ -83,7 +85,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../_Build/MacOS/Template.dmg"
export_path="../_Build/MacOS/Snake-3D.dmg"
script_export_mode=1
script_encryption_key=""

Expand All @@ -94,21 +96,33 @@ custom_template/release=""
application/name=""
application/info="Made with Godot Engine"
application/icon=""
application/identifier="com.201flaviosilva.Template"
application/identifier="com.201flaviosilva.Snake3D"
application/signature=""
application/app_category="Games"
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
privacy/camera_usage_description=""
privacy/location_usage_description=""
privacy/address_book_usage_description=""
privacy/calendar_usage_description=""
privacy/photos_library_usage_description=""
privacy/desktop_folder_usage_description=""
privacy/documents_folder_usage_description=""
privacy/downloads_folder_usage_description=""
privacy/network_volumes_usage_description=""
privacy/removable_volumes_usage_description=""
codesign/enable=true
codesign/identity=""
codesign/timestamp=true
codesign/hardened_runtime=true
codesign/replace_existing_signature=true
codesign/entitlements/custom_file=""
codesign/entitlements/allow_jit_code_execution=false
codesign/entitlements/allow_unsigned_executable_memory=false
codesign/entitlements/allow_dyld_environment_variables=false
codesign/entitlements/disable_library_validation=false
codesign/entitlements/audio_input=false
codesign/entitlements/camera=false
Expand Down Expand Up @@ -145,7 +159,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../_Build/Linux/Template.x86_64"
export_path="../_Build/Linux/Snake-3D.x86_64"
script_export_mode=1
script_encryption_key=""

Expand Down
Binary file modified Project/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 48 additions & 4 deletions Project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,59 @@

config_version=4

_global_script_classes=[ ]
_global_script_class_icons={
}

[application]

config/name="Template Repository"
run/main_scene="res://src/Scenes/Start.tscn"
config/name="Snake 3D"
run/main_scene="res://Scenes/Game2D.tscn"
config/icon="res://icon.png"

[physics]
[display]

window/size/width=1280
window/size/height=704
window/stretch/mode="2d"
window/stretch/aspect="keep"

[input]

up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
run={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}

[mono]

common/enable_pause_aware_picking=true
project/assembly_name="Snake 3D"

[rendering]

Expand Down
93 changes: 0 additions & 93 deletions Project/src/Assets/Fonts/PressStart2P/OFL.txt

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions Project/src/Assets/Fonts/PressStart2P/Ref.md

This file was deleted.

Binary file removed Project/src/Assets/Sprites/Balls/Blue.png
Binary file not shown.
Loading

0 comments on commit ec2e06a

Please sign in to comment.