Initial commit
Has basic side to side movement and a basic jump Signed-off-by: Ethan Wellenreiter <ewellenreiter@gmail.com>
This commit is contained in:
parent
8b7f872ad2
commit
99d09e2555
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Normalize EOL for all files that Git considers text files.
|
||||||
|
* text=auto eol=lf
|
||||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Godot 4+ specific ignores
|
||||||
|
.godot/
|
||||||
|
/android/
|
||||||
|
*.import
|
||||||
BIN
assets/background.png
Normal file
BIN
assets/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 503 KiB |
BIN
assets/ground.png
Normal file
BIN
assets/ground.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
BIN
assets/test_player.png
Normal file
BIN
assets/test_player.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
1
icon.svg
Normal file
1
icon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 994 B |
4
ideas.md
Normal file
4
ideas.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# IDEAS FOR GAME JAM
|
||||||
|
|
||||||
|
1. it's actually below
|
||||||
|
- upside down world. the whole time, they are going down. only to reach the bottom and gravity flips and they see the whole world they were in above
|
||||||
36
player/player.gd
Normal file
36
player/player.gd
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
extends CharacterBody2D
|
||||||
|
class_name Player
|
||||||
|
|
||||||
|
|
||||||
|
@export var SPEED = 300.0
|
||||||
|
@export var JUMP_VELOCITY = -400.0
|
||||||
|
|
||||||
|
func add_gravity(delta: float) -> void:
|
||||||
|
velocity += get_gravity() * delta
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
|
||||||
|
var vertically_held : bool = false
|
||||||
|
if is_on_floor():
|
||||||
|
vertically_held = true
|
||||||
|
|
||||||
|
# handle the stuff here with if it's hanging at the time
|
||||||
|
|
||||||
|
|
||||||
|
# Add the gravity.
|
||||||
|
if not vertically_held:
|
||||||
|
add_gravity(delta)
|
||||||
|
|
||||||
|
# Handle jump.
|
||||||
|
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||||
|
velocity.y = JUMP_VELOCITY
|
||||||
|
|
||||||
|
# Get the input direction and handle the movement/deceleration.
|
||||||
|
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||||
|
var direction := Input.get_axis("ui_left", "ui_right")
|
||||||
|
if direction:
|
||||||
|
velocity.x = direction * SPEED
|
||||||
|
else:
|
||||||
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
|
move_and_slide()
|
||||||
20
player/player.tscn
Normal file
20
player/player.tscn
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://brhc07imuholv"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://tfyg7vamdt4q" path="res://assets/test_player.png" id="1_0ushe"]
|
||||||
|
[ext_resource type="Script" path="res://player/player.gd" id="1_x227h"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fbsbu"]
|
||||||
|
size = Vector2(96, 306)
|
||||||
|
|
||||||
|
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||||
|
script = ExtResource("1_x227h")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
scale = Vector2(0.25, 0.25)
|
||||||
|
texture = ExtResource("1_0ushe")
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(-2, 0)
|
||||||
|
shape = SubResource("RectangleShape2D_fbsbu")
|
||||||
20
project.godot
Normal file
20
project.godot
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="What's below"
|
||||||
|
run/main_scene="res://ui/main menu/main_menu.tscn"
|
||||||
|
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
Universe="*res://world/universe/universe.gd"
|
||||||
3
ui/credits/credits.tscn
Normal file
3
ui/credits/credits.tscn
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[gd_scene format=3 uid="uid://c6pcfriyav1bi"]
|
||||||
|
|
||||||
|
[node name="Credits" type="Node2D"]
|
||||||
33
ui/main menu/main_menu.gd
Normal file
33
ui/main menu/main_menu.gd
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
@onready var play: Button = %Play
|
||||||
|
@onready var options: Button = %Options
|
||||||
|
@onready var credits: Button = %Credits
|
||||||
|
@onready var quit: Button = %Quit
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _on_play_pressed() -> void:
|
||||||
|
#await get_tree().create_timer(20).timeout
|
||||||
|
print("Pressed play")
|
||||||
|
Universe.switch_scene(2)
|
||||||
|
|
||||||
|
|
||||||
|
#func _on_options_pressed() -> void:
|
||||||
|
#pass # Replace with function body.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
func _on_credits_pressed() -> void:
|
||||||
|
Universe.switch_scene(3)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_quit_pressed() -> void:
|
||||||
|
get_tree().quit()
|
||||||
53
ui/main menu/main_menu.tscn
Normal file
53
ui/main menu/main_menu.tscn
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://jy7jx2xayf14"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://ui/main menu/main_menu.gd" id="1_226f7"]
|
||||||
|
|
||||||
|
[node name="MainMenu" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
script = ExtResource("1_226f7")
|
||||||
|
|
||||||
|
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = 196.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
|
||||||
|
custom_minimum_size = Vector2(250, 200)
|
||||||
|
layout_mode = 2
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_font_sizes/font_size = 29
|
||||||
|
text = "What's below"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="Play" type="Button" parent="CenterContainer/VBoxContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Play"
|
||||||
|
|
||||||
|
[node name="Credits" type="Button" parent="CenterContainer/VBoxContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Credits"
|
||||||
|
|
||||||
|
[node name="Quit" type="Button" parent="CenterContainer/VBoxContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Quit"
|
||||||
|
|
||||||
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/Play" to="." method="_on_play_pressed"]
|
||||||
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/Credits" to="." method="_on_credits_pressed"]
|
||||||
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/Quit" to="." method="_on_quit_pressed"]
|
||||||
53
world/universe/universe.gd
Normal file
53
world/universe/universe.gd
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
|
||||||
|
@onready var this_scene = load("res://scenes/universe/universe.tscn")
|
||||||
|
@onready var main_menu_scene = load("res://ui/main menu/main_menu.tscn")
|
||||||
|
|
||||||
|
@onready var level_one = load("res://world/world_level/level.tscn")
|
||||||
|
@onready var credits = load("res://ui/credits/credits.tscn")
|
||||||
|
|
||||||
|
@onready var current_level = -1
|
||||||
|
@onready var current_scene: Node
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
#get_tree().change_scene_to_packed(opening_cutscene)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
if (get_tree().current_scene != null):
|
||||||
|
current_scene = get_tree().current_scene
|
||||||
|
#print(get_tree().current_scene)
|
||||||
|
#pass
|
||||||
|
|
||||||
|
func switch_scene(sceneNo: int):
|
||||||
|
match sceneNo:
|
||||||
|
#0:
|
||||||
|
#current_level = 0
|
||||||
|
#get_tree().change_scene_to_packed(opening_cutscene)
|
||||||
|
1:
|
||||||
|
current_level = 1
|
||||||
|
get_tree().change_scene_to_packed(main_menu_scene)
|
||||||
|
2:
|
||||||
|
current_level = 2
|
||||||
|
get_tree().change_scene_to_packed(level_one)
|
||||||
|
3:
|
||||||
|
current_level = 3
|
||||||
|
get_tree().change_scene_to_packed(credits)
|
||||||
|
|
||||||
|
#func start_timer(seconds: float):
|
||||||
|
#timer_component.start(seconds)
|
||||||
|
#
|
||||||
|
#func get_time_left():
|
||||||
|
#if !timer_component.is_stopped():
|
||||||
|
#return timer_component.time_left
|
||||||
|
#else:
|
||||||
|
#return 0.0
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#func _on_timer_component_timeout() -> void:
|
||||||
|
#pass
|
||||||
6
world/universe/universe.tscn
Normal file
6
world/universe/universe.tscn
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://ybs72j611bwu"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://world/universe/universe.gd" id="1_d1y0f"]
|
||||||
|
|
||||||
|
[node name="Universe" type="Node3D"]
|
||||||
|
script = ExtResource("1_d1y0f")
|
||||||
4500
world/world_level/background_tile_set.tres
Normal file
4500
world/world_level/background_tile_set.tres
Normal file
File diff suppressed because it is too large
Load Diff
36
world/world_level/level.tscn
Normal file
36
world/world_level/level.tscn
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
[gd_scene load_steps=5 format=3 uid="uid://dojvn2guqhhel"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cs8xfi82lox77" path="res://assets/background.png" id="1_t0pgr"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://brhc07imuholv" path="res://player/player.tscn" id="2_fpbhy"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cdr8heif70pkh" path="res://assets/ground.png" id="3_rvbjd"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ptfhu"]
|
||||||
|
size = Vector2(1158, 598)
|
||||||
|
|
||||||
|
[node name="Level" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Background" type="TextureRect" parent="."]
|
||||||
|
offset_left = -31138.0
|
||||||
|
offset_top = -27910.0
|
||||||
|
offset_right = 92636.0
|
||||||
|
offset_bottom = 69138.0
|
||||||
|
scale = Vector2(0.5, 0.5)
|
||||||
|
texture = ExtResource("1_t0pgr")
|
||||||
|
stretch_mode = 1
|
||||||
|
|
||||||
|
[node name="CharacterBody2D" parent="." instance=ExtResource("2_fpbhy")]
|
||||||
|
position = Vector2(397, -187)
|
||||||
|
|
||||||
|
[node name="Walls_and_ground" type="StaticBody2D" parent="."]
|
||||||
|
position = Vector2(574.5, 200.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls_and_ground"]
|
||||||
|
position = Vector2(-5.5, 88.5)
|
||||||
|
shape = SubResource("RectangleShape2D_ptfhu")
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="Walls_and_ground"]
|
||||||
|
offset_left = -1036.5
|
||||||
|
offset_top = -215.5
|
||||||
|
offset_right = 953.5
|
||||||
|
offset_bottom = -200.5
|
||||||
|
texture = ExtResource("3_rvbjd")
|
||||||
Loading…
Reference in New Issue
Block a user