a little late huh?

main
Lukas 2024-02-22 20:33:20 -05:00
commit 6b32042810
21 changed files with 114261 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
# 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

BIN
CL_MainLev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

34
CL_MainLev.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yqys05keer2l"
path="res://.godot/imported/CL_MainLev.png-833303086e32b66846cfdb9113e55f10.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://CL_MainLev.png"
dest_files=["res://.godot/imported/CL_MainLev.png-833303086e32b66846cfdb9113e55f10.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
Maintilemap_No_Shadows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cdkrvq4u78vjf"
path="res://.godot/imported/Maintilemap_No_Shadows.png-eb05d86e7f404dba510fb7a2f59d58f2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Maintilemap_No_Shadows.png"
dest_files=["res://.godot/imported/Maintilemap_No_Shadows.png-eb05d86e7f404dba510fb7a2f59d58f2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

11
Node2D.gd Normal file
View File

@ -0,0 +1,11 @@
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

35
TileMap.gd Normal file
View File

@ -0,0 +1,35 @@
extends TileMap
@onready var player =$"../CharacterBody2D"
var rng = RandomNumberGenerator.new()
# Called when the node enters the scene tree for the first time.
func _ready():
pass
func roller():
var rum = rng.randi_range(0, 200)
return rum
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var playerPos = self.local_to_map(player.position)
NewScript.playerPoScore()
#var tilePos = playerPos+Vector2i(16,2)
var tilePos = Vector2i(playerPos.x+(16),11)
var tileCheck = tilePos + Vector2i(1,1)
#print(playerPos)
#print($"../TileMap".get_cell_tile_data(0,tileCheck,false))
#print(tileCheck)
if $".".get_cell_tile_data(0,tileCheck,false) == null:
set_pattern(0,tilePos +Vector2i(3,0),tile_set.get_pattern(1))
if int(player.position.x) % 7 == 0:
var rum = roller()
if rum > 180:
set_pattern(1,tilePos-Vector2i(-8,5),tile_set.get_pattern(4))
if get_cell_tile_data(1,playerPos):
NewScript.hit()

56957
TmA42BA.tmp Normal file

File diff suppressed because it is too large Load Diff

56980
TmAP.tscn Normal file

File diff suppressed because it is too large Load Diff

3
camera.tscn Normal file
View File

@ -0,0 +1,3 @@
[gd_scene format=3 uid="uid://bg2ky0hlrhqp6"]
[node name="Camera" type="Camera2D"]

13
hud.gd Normal file
View File

@ -0,0 +1,13 @@
extends Label
@onready var map = get_tree().current_scene.get_node("TileMap")
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
set_text(str(NewScript.score))
pass

1
icon.svg Normal file
View File

@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><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 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

After

Width:  |  Height:  |  Size: 950 B

37
icon.svg.import Normal file
View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dkl2dsvheyaab"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

9
new_script.gd Normal file
View File

@ -0,0 +1,9 @@
extends Node
var score= 0
func playerPoScore():
score += 1
func hit():
score -= 50

9
node_2d.tscn Normal file
View File

@ -0,0 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://nmu0mbl68d16"]
[ext_resource type="Script" path="res://Node2D.gd" id="1_qlsc5"]
[ext_resource type="PackedScene" uid="uid://dv4jschw3ddoi" path="res://TmAP.tscn" id="2_5mhmm"]
[node name="Node2D" type="Node2D"]
script = ExtResource("1_qlsc5")
[node name="Node2D" parent="." instance=ExtResource("2_5mhmm")]

21
pla3CEB.tmp Normal file
View File

@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://cj80unawvnbwe"]
[ext_resource type="Texture2D" uid="uid://dkl2dsvheyaab" path="res://icon.svg" id="1_rxxuj"]
[ext_resource type="Script" path="res://player.gd" id="1_tegbt"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e3syr"]
[node name="CharacterBody2D" type="CharacterBody2D"]
scale = Vector2(0.3, 0.3)
script = ExtResource("1_tegbt")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(7, 7)
shape = SubResource("CircleShape2D_e3syr")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_rxxuj")
[node name="Camera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
position_smoothing_speed = 3.0

21
pla59C9.tmp Normal file
View File

@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://cj80unawvnbwe"]
[ext_resource type="Texture2D" uid="uid://dkl2dsvheyaab" path="res://icon.svg" id="1_rxxuj"]
[ext_resource type="Script" path="res://player.gd" id="1_tegbt"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e3syr"]
[node name="CharacterBody2D" type="CharacterBody2D"]
scale = Vector2(0.3, 0.3)
script = ExtResource("1_tegbt")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(7, 7)
shape = SubResource("CircleShape2D_e3syr")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_rxxuj")
[node name="Camera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
position_smoothing_speed = 3.0

36
player.gd Normal file
View File

@ -0,0 +1,36 @@
extends CharacterBody2D
const speed = 190.0
const JUMP_VELOCITY = -400.0
const accel = 1.01
const strength= 3.5
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
var input: Vector2
func get_input():
#input.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
input.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
input.x = 1
return input.normalized()
func _physics_process(delta):
var playerInput = get_input()
# Add the gravity.
if not is_on_floor():
velocity.y += gravity * delta* 3
# Handle jump.
if is_on_floor():
if Input.is_action_just_pressed("ui_accept"):
velocity.y = lerp(0.0,JUMP_VELOCITY*strength, 0.93)
velocity = lerp(velocity, playerInput * speed, .01) * Vector2(accel,accel)
velocity.x = min(velocity.x,300)
print(velocity)
move_and_slide()

23
player.tscn Normal file
View File

@ -0,0 +1,23 @@
[gd_scene load_steps=5 format=3 uid="uid://cj80unawvnbwe"]
[ext_resource type="Texture2D" uid="uid://dkl2dsvheyaab" path="res://icon.svg" id="1_rxxuj"]
[ext_resource type="Script" path="res://player.gd" id="1_tegbt"]
[ext_resource type="PackedScene" uid="uid://bg2ky0hlrhqp6" path="res://camera.tscn" id="3_rgwin"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_gj35y"]
[node name="CharacterBody2D" type="CharacterBody2D"]
scale = Vector2(0.3, 0.3)
collision_layer = 3
script = ExtResource("1_tegbt")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(7, 7)
shape = SubResource("RectangleShape2D_gj35y")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_rxxuj")
[node name="Camera" parent="." instance=ExtResource("3_rgwin")]
[editable path="Camera"]

20
project.godot Normal file
View 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="Testrun"
run/main_scene="res://TmAP.tscn"
config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg"
[autoload]
NewScript="*res://new_script.gd"