initial commit

This commit is contained in:
Ultrablob 2024-04-16 20:29:45 -04:00
commit e446938ba7
74 changed files with 3212 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

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

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

BIN
Arrow (1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

34
Arrow (1).png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cyk2dqt7ipjg1"
path="res://.godot/imported/Arrow (1).png-f7829071ab4d36b28f9cf326802d31fe.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Arrow (1).png"
dest_files=["res://.godot/imported/Arrow (1).png-f7829071ab4d36b28f9cf326802d31fe.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
Circle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

34
Circle.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cso5ufbf7u7oj"
path="res://.godot/imported/Circle.png-5aa705d158b14b9f860407e6f23b289d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Circle.png"
dest_files=["res://.godot/imported/Circle.png-5aa705d158b14b9f860407e6f23b289d.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

35
Clock.gd Normal file
View file

@ -0,0 +1,35 @@
extends CharacterBody2D
@export var speed = 250.0
func _ready():
velocity = Vector2(speed, speed)
func _physics_process(delta):
if get_last_slide_collision():
var collision: KinematicCollision2D = get_last_slide_collision()
if collision.get_collider():
hit(collision.get_collider())
velocity = velocity.bounce(clamp_to_1bit(collision.get_normal()))
move_and_slide()
func clamp_to_1bit(normal: Vector2):
var normals = [Vector2(1, 0), Vector2(0, 1), Vector2(-1, 0), Vector2(0, -1)]
var closest_normal = normals[0]
var max_dot_product = normal.dot(closest_normal)
for i in range(1, normals.size()):
var dot_product = normal.dot(normals[i])
if dot_product > max_dot_product:
max_dot_product = dot_product
closest_normal = normals[i]
return closest_normal
func hit(body):
if body.is_in_group("destructible"):
if body.has_method("destroy"):
body.destroy()
else:
body.queue_free()

11
CollisionCheck.gd Normal file
View file

@ -0,0 +1,11 @@
extends ShapeCast2D
func is_clear(area: Vector2):
position = area
force_shapecast_update()
return get_collision_count() == 0
func flash():
$Sprite2D.visible = true
await get_tree().create_timer(0.2).timeout # waits for .2 seconds
$Sprite2D.visible = false

29
Countdown.gd Normal file
View file

@ -0,0 +1,29 @@
extends Label
var target_time = null
func _on_request_completed(result, response_code, headers, body):
var json = JSON.parse_string(body.get_string_from_utf8())
print(json)
if json and "timestamp" in json:
target_time = json["timestamp"]
# Called when the node enters the scene tree for the first time.
func _ready():
update_time()
func update_time():
target_time = null
$HTTPRequest.request_completed.connect(_on_request_completed)
$HTTPRequest.request("https://flask-hello-world-nine-psi.vercel.app")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if target_time:
var time_remaining = target_time - Time.get_unix_time_from_system() + 3600 * 4 # correct for EDT timezone
if time_remaining < 0:
update_time()
var remaining_minutes = floor(time_remaining / 60)
var remaining_seconds = int(time_remaining) % 60
text = "%d:%02d" % [remaining_minutes, remaining_seconds]
else:
text = "Loading"

17
Entagon.gd Normal file
View file

@ -0,0 +1,17 @@
extends RigidBody2D
@onready var player = $"../Player"
func hit(body):
if body.is_in_group("destructible"):
if body.has_method("destroy"):
body.destroy()
else:
body.queue_free()
queue_free()
if body.name == "Border":
queue_free()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
apply_central_force((global_position - player.global_position).normalized() * -300)

11
FillScreen.gd Normal file
View file

@ -0,0 +1,11 @@
extends Label
# 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):
size = get_viewport().size

15
GameManager.gd Normal file
View file

@ -0,0 +1,15 @@
extends Node2D
func _ready():
process_mode = Node.PROCESS_MODE_ALWAYS
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
if event.is_action_pressed("restart"):
get_tree().paused = false
get_tree().reload_current_scene()

27
GravityGrapple.gd Normal file
View file

@ -0,0 +1,27 @@
extends RayCast2D
var active = false
@export var force = -1000
# 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 _physics_process(delta):
if active:
$Marker2D.node.apply_central_force(($Marker2D.node.global_position - global_position).normalized() * force)
$"..".apply_central_force((global_position - $Marker2D.node.global_position).normalized() * force)
func _input(event):
if event.is_action_pressed("shoot"):
if (not is_colliding()) or (not get_collider() is RigidBody2D):
return
$Line2D.visible = true
active = true
$Marker2D.node = get_collider()
$Marker2D.offset = get_collider().global_position - get_collision_point()
elif event.is_action_released("shoot"):
$Line2D.visible = false
active = false

11
Gun.gd Normal file
View file

@ -0,0 +1,11 @@
extends Marker2D
@export var bullet: PackedScene
func shoot():
print("Shooting")
var node = bullet.instantiate()
node.global_position = global_position
node.linear_velocity = Vector2(500, 0).rotated(global_rotation)
print(node.linear_velocity)
$/root/Node2D.add_child(node)

BIN
Hexagon outline.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://xq1dd6w22i6f"
path="res://.godot/imported/Hexagon outline.png-ad717813cdc35ccaddcd417e4a24f3ba.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Hexagon outline.png"
dest_files=["res://.godot/imported/Hexagon outline.png-ad717813cdc35ccaddcd417e4a24f3ba.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
Hexagon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

34
Hexagon.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://baaak3ooc6rvq"
path="res://.godot/imported/Hexagon.png-1b862bf89e6b7922fd88f522a8d27f58.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Hexagon.png"
dest_files=["res://.godot/imported/Hexagon.png-1b862bf89e6b7922fd88f522a8d27f58.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

14
InfiniteGradient.gd Normal file
View file

@ -0,0 +1,14 @@
extends TextureRect
@export var speed = 30
# 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):
var move_amount = delta * speed
self.size.x += move_amount
self.position.x -= move_amount

14
Laser.gd Normal file
View file

@ -0,0 +1,14 @@
extends Line2D
# Called when the node enters the scene tree for the first time.
func _ready():
modulate = Color(Color.WHITE, 0.2)
pass # Replace with function body.
func fire():
$VisibleTimer.start()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
#print(points)
points[1] = to_local($RayCast2D.get_collision_point())

58
Leaderboard.gd Normal file
View file

@ -0,0 +1,58 @@
extends Label
@export var stopwatch: Stopwatch
func get_scores():
$HTTPRequest.request("https://flask-hello-world-nine-psi.vercel.app/leaderboard")
func submit_score():
var encrypted_score = "EGH" + Marshalls.utf8_to_base64(str(stopwatch.time_elapsed))
print(encrypted_score)
$HTTPRequest.request_completed.connect(_on_request_completed)
$HTTPRequest.request("https://flask-hello-world-nine-psi.vercel.app/leaderboard?score=%s" % encrypted_score, [], HTTPClient.METHOD_POST)
func _on_request_completed(result, response_code, headers, body):
if body.get_string_from_utf8() == "OK":
get_scores()
return true
var json = JSON.parse_string(body.get_string_from_utf8())
#print(json)
if json and "scores" in json:
var scores = json["scores"]
#print(scores)
var score = stopwatch.time_elapsed
var placement = closest(score, scores)
print(placement)
print(len(scores))
if placement < 50:
text = "You placed #%d\n" % [placement]
else:
text = "You placed top %d%%\n" % [(float(placement) / len(scores)) * 100]
var n = 1
while n <= 5 and n <= len(scores):
text += "%d. %s\n" % [ n, seconds2mmss(scores[n-1]) ]
n += 1
func closest(my_number:int, my_array:Array)->int:
# Initialize
var closest_num:int
var closest_delta:int = 0
var closest_idx = -1
var temp_delta:int = 0
# Loop through entire array
for i in range(my_array.size()):
if my_array[i] == my_number: return my_array[i] # exact match found!
temp_delta = int(abs(my_array[i]-my_number))
if closest_delta == 0 or temp_delta < closest_delta:
closest_num = my_array[i]
closest_idx = i
closest_delta = temp_delta
# Return closest number found
return closest_idx
func seconds2mmss(total_seconds: float) -> String:
var seconds: float = fmod(total_seconds , 60.0)
var minutes: int = int(total_seconds / 60.0) % 60
var hhmmss_string: String = "%02d:%05.2f" % [minutes, seconds]
return hhmmss_string

11
Leaderborad.gd Normal file
View file

@ -0,0 +1,11 @@
extends Label
# 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

5
LockedRotation.gd Normal file
View file

@ -0,0 +1,5 @@
extends CollisionShape2D
# Called every physics frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
global_rotation = 0

9
Notification.gd Normal file
View file

@ -0,0 +1,9 @@
extends Label
func notify(notification_text):
text = notification_text
modulate = Color.WHITE
var tween = get_tree().create_tween()
tween.tween_property(self, "modulate", Color.TRANSPARENT, 1).set_ease(Tween.EASE_OUT)

BIN
Pentagon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

34
Pentagon.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://3y48ijiv4vlf"
path="res://.godot/imported/Pentagon.png-7ed5bfa4e2087f30c59e5bfaa438c497.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pentagon.png"
dest_files=["res://.godot/imported/Pentagon.png-7ed5bfa4e2087f30c59e5bfaa438c497.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

14
PinnedLine.gd Normal file
View file

@ -0,0 +1,14 @@
extends Line2D
@export var point_a: Node2D
@export var point_b: Node2D
# Called when the node enters the scene tree for the first time.
func _ready():
top_level = true
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
points[0] = point_a.global_position
points[1] = point_b.global_position

14
PinnedNode.gd Normal file
View file

@ -0,0 +1,14 @@
extends Node2D
@export var offset = Vector2.ZERO
@export var node: 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):
if node:
global_position = node.global_position - offset

71
Player.gd Normal file
View file

@ -0,0 +1,71 @@
extends RigidBody2D
var speed = 1000 # move speed in pixels/sec
var rotation_speed = 3 # turning speed in radians/sec
var quare = preload("res://quare.tscn")
var exagon = preload("res://exagon.tscn")
@onready var notifier = $"../Notification"
var num_quares = 0
var max_quares = 3
var exagons = 1
func _ready():
update_display()
func _physics_process(delta):
look_at(get_global_mouse_position())
var move_input = Input.get_axis("down", "up")
var side_input = Input.get_axis("right", "left")
apply_central_force(transform.y * side_input * speed / 2 + transform.x * move_input * speed)
func _input(event):
if event.is_action_pressed("jump"):
global_position = get_global_mouse_position()
if event.is_action_pressed("quare"):
if num_quares >= max_quares:
notifier.notify("All Quares in Use!")
return
if not $"../CollisionCheck".is_clear(get_global_mouse_position()):
$"../CollisionCheck".flash()
notifier.notify("Too Close!")
return
num_quares += 1
var new_quare = quare.instantiate()
new_quare.position = get_global_mouse_position()
$/root/Node2D.add_child(new_quare)
new_quare.name = "Quare"
update_display()
if event.is_action_pressed("exagon"):
if exagons <= 0:
notifier.notify("No Exagons!")
return
if not $"../CollisionCheck".is_clear(get_global_mouse_position()):
$"../CollisionCheck".flash()
notifier.notify("Too Close!")
return
exagons -= 1
var new_exagon = exagon.instantiate()
new_exagon.position = get_global_mouse_position()
$/root/Node2D.add_child(new_exagon)
new_exagon.name = "Exagon"
update_display()
#$Gun.shoot()
func aquire_quare():
await get_tree().create_timer(3).timeout
num_quares -= 1
update_display()
func aquire_exagon():
await get_tree().create_timer(15).timeout
exagons += 1
update_display()
func update_display():
$"../UI/Quare Count".text = "%d Quares\n%d Exagons" % [(max_quares - num_quares), exagons]
func destroy():
get_tree().paused = true
$"../GameOver".visible = true

93
Preahvihear/OFL.txt Normal file
View file

@ -0,0 +1,93 @@
Copyright 2019 The Preahvihear Project Authors (https://github.com/danhhong/Preahvihear)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://dsw5w316y4v54"
path="res://.godot/imported/Preahvihear-Regular.ttf-fe12a5de018003b711dd7856f0e35e17.fontdata"
[deps]
source_file="res://Preahvihear/Preahvihear-Regular.ttf"
dest_files=["res://.godot/imported/Preahvihear-Regular.ttf-fe12a5de018003b711dd7856f0e35e17.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

11
ScreenPosCamera.gd Normal file
View file

@ -0,0 +1,11 @@
extends Camera2D
# 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):
position = get_viewport().position

15
Shield.gd Normal file
View file

@ -0,0 +1,15 @@
extends StaticBody2D
@export var health = 10
var max_health = 10.0
func destroy():
health -= 1
if health <= 0:
if not is_queued_for_deletion():
$"../../Player".aquire_exagon()
$"..".queue_free()
modulate = Color(Color.CYAN, 0.7 - lerp(0.7, 0.1, health / max_health))

15
Spawner.gd Normal file
View file

@ -0,0 +1,15 @@
extends Marker2D
@export var item: PackedScene
@export var random_on_screen = false
func spawn():
for i in range(10):
var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080)
if not $"../CollisionCheck".is_clear(test_pos):
continue
var node = item.instantiate()
node.global_position = test_pos
print(node.global_position)
$/root/Node2D.add_child(node)
break

16
Stopwatch.gd Normal file
View file

@ -0,0 +1,16 @@
extends Label
class_name Stopwatch
var time_elapsed: float = 0.0
func _process(delta: float) -> void:
if not get_tree().paused:
time_elapsed += delta
text = seconds2hhmmss(time_elapsed)
func seconds2hhmmss(total_seconds: float) -> String:
#total_seconds = 12345
var seconds: float = fmod(total_seconds , 60.0)
var minutes: int = int(total_seconds / 60.0) % 60
var hhmmss_string: String = "%02d:%05.2f" % [minutes, seconds]
return hhmmss_string

19
TextCollision.gd Normal file
View file

@ -0,0 +1,19 @@
extends CollisionShape2D
@onready var font: Font = $"../Label".get_theme_font("font")
# Called when the node enters the scene tree for the first time.
func _ready():
update_size()
func update_size():
var bbox = font.get_string_size($"../Label".text, HORIZONTAL_ALIGNMENT_LEFT, -1, $"../Label".get_theme_font_size("font_size"))
#print(bbox)
bbox.y /= 2.2
bbox.x -= 20
get_shape().extents = bbox / 2
#print(bbox)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
update_size()

14
TrajectoryDisplay.gd Normal file
View file

@ -0,0 +1,14 @@
extends Line2D
func _ready():
$RayCast2D.target_position = $"..".linear_velocity * 5000
$RayCast2D.force_raycast_update()
func _physics_process(delta):
#global_rotation = $"..".linear_velocity.angle()
$RayCast2D.target_position = $"..".linear_velocity * 5000
points[1] = $"..".linear_velocity * 5000
if $RayCast2D.get_collider() != null and $RayCast2D.get_collider().name == "Player":
visible = true
else:
visible = false

BIN
Triangle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

34
Triangle.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cartrcqnympin"
path="res://.godot/imported/Triangle.png-c25f011309dbe36c17c05935f6be0fb3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Triangle.png"
dest_files=["res://.godot/imported/Triangle.png-c25f011309dbe36c17c05935f6be0fb3.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

18
WorldBorder.gd Normal file
View file

@ -0,0 +1,18 @@
extends CollisionShape2D
enum AXIS {X, Y}
@export var match_axis = AXIS.X
# Called when the node enters the scene tree for the first time.
func _ready():
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var size = get_viewport().size
if match_axis == AXIS.X:
self.position.x = size.x
elif match_axis == AXIS.Y:
self.position.y = size.y

BIN
addons/.DS_Store vendored Normal file

Binary file not shown.

BIN
addons/godot-git-plugin/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2023 The Godot Engine community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
[configuration]
entry_symbol = "git_plugin_init"
compatibility_minimum = "4.1.0"
[libraries]
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
windows.editor.x86_64 = "win64/libgit_plugin.windows.editor.x86_64.dll"
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
linux.editor.arm64 = "linux/libgit_plugin.linux.editor.arm64.so"
linux.editor.rv64 = ""

View file

@ -0,0 +1,7 @@
[plugin]
name="Godot Git Plugin"
description="This plugin lets you interact with Git without leaving the Godot editor. More information can be found at https://github.com/godotengine/godot-git-plugin/wiki"
author="twaritwaikar"
version="v3.1.1"
script="godot-git-plugin.gd"

18
bullet.gd Normal file
View file

@ -0,0 +1,18 @@
extends RigidBody2D
var bounces = 0
func hit(body):
if body.is_in_group("destructible"):
if body.has_method("destroy"):
body.destroy()
else:
body.queue_free()
queue_free()
else:
bounces += 1
#print(bounces)
if bounces >= 2:
queue_free()

61
bullet.tscn Normal file
View file

@ -0,0 +1,61 @@
[gd_scene load_steps=9 format=3 uid="uid://c6ybtahxwpukd"]
[ext_resource type="Script" path="res://bullet.gd" id="1_3q13i"]
[ext_resource type="Texture2D" uid="uid://cso5ufbf7u7oj" path="res://Circle.png" id="1_if042"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="2_cbxu4"]
[ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="4_h1jno"]
[ext_resource type="Script" path="res://TrajectoryDisplay.gd" id="5_0jcwc"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_xnhwp"]
friction = 0.0
bounce = 1.0
[sub_resource type="CircleShape2D" id="CircleShape2D_b5cca"]
radius = 13.0
[sub_resource type="GradientTexture1D" id="GradientTexture1D_tltp1"]
gradient = ExtResource("2_cbxu4")
width = 1024
[node name="Bullet" type="RigidBody2D"]
collision_layer = 2
physics_material_override = SubResource("PhysicsMaterial_xnhwp")
gravity_scale = 1.66533e-16
max_contacts_reported = 1
contact_monitor = true
linear_velocity = Vector2(2.08165e-12, 2.08165e-12)
script = ExtResource("1_3q13i")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = -1.5708
shape = SubResource("CircleShape2D_b5cca")
[node name="Sprite2D" type="Sprite2D" parent="."]
clip_children = 1
scale = Vector2(0.05, 0.05)
texture = ExtResource("1_if042")
[node name="TextureRect" type="TextureRect" parent="Sprite2D"]
offset_left = -280.0
offset_top = -280.0
offset_right = 744.0
offset_bottom = -240.0
scale = Vector2(1, 13.8)
texture = SubResource("GradientTexture1D_tltp1")
[node name="TrajectoryDisplay" type="Line2D" parent="."]
z_index = -1
texture_repeat = 2
position = Vector2(-2, 0)
points = PackedVector2Array(0, 0, 2000, 2.08165e-12)
width = 50.0
default_color = Color(0.909804, 0.717647, 0.337255, 0.529412)
texture = ExtResource("4_h1jno")
texture_mode = 1
script = ExtResource("5_0jcwc")
[node name="RayCast2D" type="RayCast2D" parent="TrajectoryDisplay"]
target_position = Vector2(5000, 2.08165e-12)
collision_mask = 3
[connection signal="body_entered" from="." to="." method="hit"]

BIN
dotted line.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

34
dotted line.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djfjdlri5xdkn"
path="res://.godot/imported/dotted line.png-e957b055d2b4cfff3d51ae09a585a9b8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://dotted line.png"
dest_files=["res://.godot/imported/dotted line.png-e957b055d2b4cfff3d51ae09a585a9b8.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

5
elastic.tres Normal file
View file

@ -0,0 +1,5 @@
[gd_resource type="PhysicsMaterial" format=3 uid="uid://c5tm7od8mwjjb"]
[resource]
friction = 0.0
bounce = 1.0

37
entagon.tscn Normal file
View file

@ -0,0 +1,37 @@
[gd_scene load_steps=6 format=3 uid="uid://c54oi61t8bvtu"]
[ext_resource type="Script" path="res://Entagon.gd" id="1_726g8"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_pvpk5"]
[ext_resource type="Texture2D" uid="uid://3y48ijiv4vlf" path="res://Pentagon.png" id="2_rhkcn"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="3_13sdt"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_ebpuq"]
gradient = ExtResource("3_13sdt")
width = 2048
[node name="Entagon" type="RigidBody2D"]
physics_material_override = ExtResource("1_pvpk5")
gravity_scale = 1.66533e-16
max_contacts_reported = 2
contact_monitor = true
linear_damp = 0.1
angular_velocity = 0.174533
script = ExtResource("1_726g8")
[node name="Sprite2D" type="Sprite2D" parent="."]
clip_children = 1
scale = Vector2(0.1, 0.1)
texture = ExtResource("2_rhkcn")
[node name="TextureRect" type="TextureRect" parent="Sprite2D"]
offset_left = -1324.0
offset_top = -301.0
offset_right = 724.0
offset_bottom = 242.0
texture = SubResource("GradientTexture1D_ebpuq")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
scale = Vector2(0.1, 0.1)
polygon = PackedVector2Array(0, -227, 236, -55, 143, 221, -144, 219, -230, -51)
[connection signal="body_entered" from="." to="." method="hit"]

47
exagon.tscn Normal file
View file

@ -0,0 +1,47 @@
[gd_scene load_steps=8 format=3 uid="uid://c87easb8570vd"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_1oplx"]
[ext_resource type="Script" path="res://Shield.gd" id="2_q7qjq"]
[ext_resource type="Texture2D" uid="uid://xq1dd6w22i6f" path="res://Hexagon outline.png" id="2_x53yb"]
[ext_resource type="Texture2D" uid="uid://baaak3ooc6rvq" path="res://Hexagon.png" id="3_tj1rx"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="4_14wdv"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_d2ef1"]
gradient = ExtResource("4_14wdv")
width = 4096
[sub_resource type="CircleShape2D" id="CircleShape2D_evq3y"]
radius = 25.0
[node name="Exagon" type="Node2D"]
[node name="Shield" type="StaticBody2D" parent="." groups=["destructible"]]
collision_layer = 2
collision_mask = 2
physics_material_override = ExtResource("1_1oplx")
script = ExtResource("2_q7qjq")
[node name="Sprite" type="Sprite2D" parent="Shield"]
self_modulate = Color(0.529412, 0.819608, 1, 0.27451)
texture = ExtResource("2_x53yb")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Shield"]
position = Vector2(13, 194)
polygon = PackedVector2Array(-13, -443, 204, -317, 206, -69, -12, 57, -231, -71, -231, -316)
[node name="Generator" type="StaticBody2D" parent="."]
[node name="Sprite" type="Sprite2D" parent="Generator"]
clip_children = 1
scale = Vector2(0.1, 0.1)
texture = ExtResource("3_tj1rx")
[node name="TextureRect" type="TextureRect" parent="Generator/Sprite"]
offset_left = -2110.0
offset_top = -490.0
offset_right = 1986.0
offset_bottom = 534.0
texture = SubResource("GradientTexture1D_d2ef1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Generator"]
shape = SubResource("CircleShape2D_evq3y")

37
export_presets.cfg Normal file
View file

@ -0,0 +1,37 @@
[preset.0]
name="Web"
platform="Web"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../Build/index.html"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
[preset.0.options]
custom_template/debug=""
custom_template/release=""
variant/extensions_support=false
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)

7
gradient.tres Normal file
View file

@ -0,0 +1,7 @@
[gd_resource type="Gradient" format=3 uid="uid://c41berdx2rqpw"]
[resource]
offsets = PackedFloat32Array(0.00649351, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5, 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1)
colors = PackedColorArray(0.901961, 0.168627, 0.658824, 1, 0.890196, 0.188235, 0.34902, 1, 0.886275, 0.254902, 0.254902, 1, 0.945098, 0.45098, 0.239216, 1, 0.988235, 0.858824, 0.392157, 1, 0.286275, 0.886275, 0.356863, 1, 0.188235, 0.8, 0.623529, 1, 0.223529, 0.823529, 0.752941, 1, 0.266667, 0.666667, 0.917647, 1, 0.364706, 0.415686, 0.952941, 1, 0.635294, 0.294118, 0.807843, 1, 0.752941, 0.156863, 0.713726, 1, 0.901961, 0.168627, 0.658824, 1, 0.890196, 0.188235, 0.34902, 1, 0.886275, 0.254902, 0.254902, 1, 0.945098, 0.45098, 0.239216, 1, 0.901961, 0.168627, 0.658824, 1)
metadata/_snap_enabled = true
metadata/_snap_count = 16

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://dbnms6rydhcxp"
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

59
ircle.tscn Normal file
View file

@ -0,0 +1,59 @@
[gd_scene load_steps=7 format=3 uid="uid://4lc6bvf7b8a0"]
[ext_resource type="Script" path="res://laser_enemy.gd" id="2_lyi2i"]
[ext_resource type="Script" path="res://Laser.gd" id="3_hosl5"]
[ext_resource type="Texture2D" uid="uid://cso5ufbf7u7oj" path="res://Circle.png" id="4_kq1iu"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="5_4gq2q"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_cis1o"]
gradient = ExtResource("5_4gq2q")
[sub_resource type="CircleShape2D" id="CircleShape2D_yns8h"]
radius = 128.0
[node name="Ircle" type="StaticBody2D" groups=["destructible"]]
scale = Vector2(0.2, 0.2)
script = ExtResource("2_lyi2i")
[node name="Line2D" type="Line2D" parent="."]
z_index = -2
points = PackedVector2Array(0, 0, 5000, 2.08165e-12)
width = 100.0
default_color = Color(0.886275, 0.254902, 0.254902, 1)
end_cap_mode = 2
script = ExtResource("3_hosl5")
[node name="VisibleTimer" type="Timer" parent="Line2D"]
wait_time = 0.2
[node name="RayCast2D" type="RayCast2D" parent="Line2D"]
target_position = Vector2(50000, 2.08165e-12)
collision_mask = 3
[node name="Sprite2D" type="Sprite2D" parent="."]
clip_children = 1
scale = Vector2(0.5, 0.5)
texture = ExtResource("4_kq1iu")
[node name="TextureRect" type="TextureRect" parent="Sprite2D"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -1700.0
offset_top = -370.0
offset_right = -1700.0
offset_bottom = -370.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(5, 2)
texture = SubResource("GradientTexture1D_cis1o")
[node name="Timer" type="Timer" parent="."]
wait_time = 3.0
autostart = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_yns8h")
[connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="hide_self"]
[connection signal="timeout" from="Timer" to="." method="fire_laser"]

50
laser_enemy.gd Normal file
View file

@ -0,0 +1,50 @@
extends StaticBody2D
@onready var player = $"../Player"
var aiming = true
# 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):
if aiming:
look_at(player.global_position)
func fire_laser():
var tween = get_tree().create_tween()
aiming = false
tween.set_parallel(true)
tween.tween_property($Sprite2D/TextureRect, "position", Vector2(-2000, -370), 1).set_ease(Tween.EASE_IN_OUT)
tween.tween_property($Line2D, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_IN)
tween.set_parallel(false)
tween.tween_callback($Line2D.fire)
tween.tween_interval(0.2)
tween.tween_callback(check_player)
tween.set_parallel(true)
tween.tween_property($Line2D, "modulate", Color(Color.WHITE, 0.2), 0.2).set_ease(Tween.EASE_OUT)
tween.tween_property($Sprite2D/TextureRect, "position", Vector2(-1700, -370), 0.5).set_ease(Tween.EASE_IN_OUT)
tween.set_parallel(false)
tween.tween_callback(start_aim)
func start_aim():
aiming = true
func check_player():
var body = $Line2D/RayCast2D.get_collider()
if body != null and body.is_in_group("destructible"):
if body.has_method("destroy"):
body.destroy()
else:
body.queue_free()
func hit(body: Node2D):
if body.name == "Clock":
queue_free()
elif body.name == "Bullet":
body.queue_free()
queue_free()

325
main.tscn Normal file
View file

@ -0,0 +1,325 @@
[gd_scene load_steps=31 format=3 uid="uid://bmd4m7lqj4v0x"]
[ext_resource type="Script" path="res://InfiniteGradient.gd" id="1_0hjpt"]
[ext_resource type="Script" path="res://TextCollision.gd" id="1_hy18x"]
[ext_resource type="Script" path="res://Spawner.gd" id="1_ifu8g"]
[ext_resource type="Script" path="res://GameManager.gd" id="1_k8sg3"]
[ext_resource type="FontFile" uid="uid://dsw5w316y4v54" path="res://Preahvihear/Preahvihear-Regular.ttf" id="2_0a4qt"]
[ext_resource type="Script" path="res://Countdown.gd" id="2_qroir"]
[ext_resource type="PackedScene" uid="uid://4lc6bvf7b8a0" path="res://ircle.tscn" id="3_7jxvc"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="4_bx3xr"]
[ext_resource type="PackedScene" uid="uid://yu50iyftoyaj" path="res://riangle.tscn" id="4_icpv2"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="4_yk0bb"]
[ext_resource type="Script" path="res://Clock.gd" id="5_7po8n"]
[ext_resource type="PackedScene" uid="uid://cgcjicue76wsr" path="res://player.tscn" id="7_ujibo"]
[ext_resource type="Script" path="res://CollisionCheck.gd" id="11_ryeyk"]
[ext_resource type="Texture2D" uid="uid://cso5ufbf7u7oj" path="res://Circle.png" id="13_318fy"]
[ext_resource type="Script" path="res://Notification.gd" id="13_lkv81"]
[ext_resource type="Script" path="res://Stopwatch.gd" id="13_xhnp2"]
[ext_resource type="Script" path="res://Leaderboard.gd" id="14_v1elq"]
[ext_resource type="PackedScene" uid="uid://c54oi61t8bvtu" path="res://entagon.tscn" id="18_jl3xw"]
[sub_resource type="Gradient" id="Gradient_bi1rk"]
interpolation_mode = 1
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0.0509804, 0.0509804, 0.0509804, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_f0jwl"]
gradient = SubResource("Gradient_bi1rk")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7w8g6"]
size = Vector2(605, 225.5)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_vrv6v"]
gradient = ExtResource("4_yk0bb")
width = 4096
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_o86fr"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_0lugs"]
normal = Vector2(2.08165e-12, 1)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_nfw1m"]
normal = Vector2(1, 2.08165e-12)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_wacat"]
normal = Vector2(-1, 2.08165e-12)
[sub_resource type="CircleShape2D" id="CircleShape2D_bmvvy"]
radius = 50.0
[sub_resource type="Gradient" id="Gradient_or5lt"]
colors = PackedColorArray(1, 0, 0, 1, 1, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_cygyn"]
gradient = SubResource("Gradient_or5lt")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_ky2qs"]
gradient = ExtResource("4_yk0bb")
width = 2048
[node name="Node2D" type="Node2D"]
position = Vector2(-2, -1)
script = ExtResource("1_k8sg3")
[node name="Spawner" type="Marker2D" parent="."]
position = Vector2(1749, 999)
script = ExtResource("1_ifu8g")
item = ExtResource("3_7jxvc")
[node name="Timer" type="Timer" parent="Spawner"]
wait_time = 3.0
autostart = true
[node name="Spawner2" type="Marker2D" parent="."]
position = Vector2(1749, 999)
script = ExtResource("1_ifu8g")
item = ExtResource("4_icpv2")
[node name="Timer" type="Timer" parent="Spawner2"]
wait_time = 4.0
autostart = true
[node name="Spawner3" type="Marker2D" parent="."]
position = Vector2(3498, 1998)
script = ExtResource("1_ifu8g")
item = ExtResource("18_jl3xw")
[node name="Timer" type="Timer" parent="Spawner3"]
wait_time = 10.0
autostart = true
[node name="BG" type="TextureRect" parent="."]
z_index = -1000
offset_left = 2.0
offset_top = -5.0
offset_right = 50002.0
offset_bottom = 49995.0
texture = SubResource("GradientTexture1D_f0jwl")
[node name="Clock" type="CharacterBody2D" parent="."]
position = Vector2(201, 200)
collision_layer = 3
collision_mask = 3
motion_mode = 1
script = ExtResource("5_7po8n")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Clock"]
position = Vector2(207, 192)
scale = Vector2(0.75, 0.75)
shape = SubResource("RectangleShape2D_7w8g6")
script = ExtResource("1_hy18x")
[node name="Label" type="Label" parent="Clock"]
clip_children = 2
clip_contents = true
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 57.0
offset_top = 55.0
offset_right = 476.0
offset_bottom = 418.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(0.75, 0.75)
size_flags_horizontal = 4
theme_override_fonts/font = ExtResource("2_0a4qt")
theme_override_font_sizes/font_size = 200
text = "9:24"
horizontal_alignment = 1
vertical_alignment = 1
script = ExtResource("2_qroir")
[node name="TextureRect" type="TextureRect" parent="Clock/Label"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
rotation = -6.28319
texture = SubResource("GradientTexture1D_vrv6v")
stretch_mode = 1
script = ExtResource("1_0hjpt")
[node name="HTTPRequest" type="HTTPRequest" parent="Clock/Label"]
[node name="Border" type="StaticBody2D" parent="."]
physics_material_override = ExtResource("4_bx3xr")
[node name="Bottom" type="CollisionShape2D" parent="Border"]
position = Vector2(1080, 1080)
shape = SubResource("WorldBoundaryShape2D_o86fr")
one_way_collision_margin = 0.0
[node name="Top" type="CollisionShape2D" parent="Border"]
position = Vector2(582, 0)
shape = SubResource("WorldBoundaryShape2D_0lugs")
[node name="Left" type="CollisionShape2D" parent="Border"]
position = Vector2(0, 330)
shape = SubResource("WorldBoundaryShape2D_nfw1m")
[node name="Right" type="CollisionShape2D" parent="Border"]
position = Vector2(1920, 330)
shape = SubResource("WorldBoundaryShape2D_wacat")
[node name="Player" parent="." instance=ExtResource("7_ujibo")]
position = Vector2(110, 74)
scale = Vector2(0.5, 0.5)
[node name="UI" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 1920.0
offset_bottom = 1080.0
[node name="Quare Count" type="Label" parent="UI"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 44.0
offset_top = -137.0
offset_right = 279.0
grow_vertical = 0
theme_override_constants/line_spacing = -30
theme_override_fonts/font = ExtResource("2_0a4qt")
theme_override_font_sizes/font_size = 50
text = "2 Quares
1 Exagon"
[node name="Stopwatch" type="Label" parent="UI"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -268.0
offset_top = 22.0
offset_right = -33.0
offset_bottom = 159.0
grow_horizontal = 0
theme_override_fonts/font = ExtResource("2_0a4qt")
theme_override_font_sizes/font_size = 50
text = "10:00.24"
script = ExtResource("13_xhnp2")
[node name="GameOver" type="Label" parent="."]
visible = false
z_index = 100
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = 1920.0
offset_bottom = 1080.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
theme_override_fonts/font = ExtResource("2_0a4qt")
theme_override_font_sizes/font_size = 200
text = "Game Over!"
horizontal_alignment = 1
[node name="ColorRect" type="ColorRect" parent="GameOver"]
z_index = -1
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.372549)
[node name="GameOver" type="Label" parent="GameOver"]
z_index = 100
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -293.0
offset_top = -147.0
offset_right = 293.0
offset_bottom = -37.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("2_0a4qt")
theme_override_font_sizes/font_size = 60
text = "Press R to Restart"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Leaderboard" type="Label" parent="GameOver" node_paths=PackedStringArray("stopwatch")]
layout_mode = 1
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_top = -217.0
offset_bottom = 255.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("2_0a4qt")
theme_override_font_sizes/font_size = 50
text = "
Loading Leaderboard..."
horizontal_alignment = 1
script = ExtResource("14_v1elq")
stopwatch = NodePath("../../UI/Stopwatch")
[node name="HTTPRequest" type="HTTPRequest" parent="GameOver/Leaderboard"]
[node name="CollisionCheck" type="ShapeCast2D" parent="."]
shape = SubResource("CircleShape2D_bmvvy")
target_position = Vector2(2.08165e-12, 2.08165e-12)
collision_mask = 3
script = ExtResource("11_ryeyk")
[node name="Sprite2D" type="Sprite2D" parent="CollisionCheck"]
visible = false
self_modulate = Color(1, 0, 0, 0.356863)
clip_children = 1
scale = Vector2(0.35, 0.35)
texture = ExtResource("13_318fy")
[node name="TextureRect" type="TextureRect" parent="CollisionCheck/Sprite2D"]
offset_left = -288.0
offset_top = -288.0
offset_right = -32.0
offset_bottom = -248.0
scale = Vector2(2.19999, 15.1168)
texture = SubResource("GradientTexture1D_cygyn")
[node name="Notification" type="Label" parent="."]
modulate = Color(1, 1, 1, 0)
clip_children = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = 640.0
offset_top = 940.0
offset_right = 1280.0
offset_bottom = 963.0
grow_horizontal = 2
grow_vertical = 0
theme_override_font_sizes/font_size = 100
text = "Too Crowded"
script = ExtResource("13_lkv81")
[node name="TextureRect" type="TextureRect" parent="Notification"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
scale = Vector2(1, 3.12)
texture = SubResource("GradientTexture1D_ky2qs")
[connection signal="timeout" from="Spawner/Timer" to="Spawner" method="spawn"]
[connection signal="timeout" from="Spawner2/Timer" to="Spawner2" method="spawn"]
[connection signal="timeout" from="Spawner3/Timer" to="Spawner3" method="spawn"]
[connection signal="visibility_changed" from="GameOver/Leaderboard" to="GameOver/Leaderboard" method="submit_score"]

83
player.tscn Normal file
View file

@ -0,0 +1,83 @@
[gd_scene load_steps=10 format=3 uid="uid://cgcjicue76wsr"]
[ext_resource type="Script" path="res://Player.gd" id="1_bu0dg"]
[ext_resource type="Texture2D" uid="uid://cyk2dqt7ipjg1" path="res://Arrow (1).png" id="2_cy2gs"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="3_w0118"]
[ext_resource type="Script" path="res://InfiniteGradient.gd" id="4_hwb8d"]
[ext_resource type="Script" path="res://PinnedLine.gd" id="5_as86f"]
[ext_resource type="Script" path="res://PinnedNode.gd" id="7_6wch2"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_xdd3j"]
gradient = ExtResource("3_w0118")
[sub_resource type="Curve" id="Curve_7ru3n"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Gradient" id="Gradient_l1fxo"]
offsets = PackedFloat32Array(0.756667, 1)
colors = PackedColorArray(0.48, 0.48, 1, 1, 0.51, 0.51, 1, 0)
[node name="Player" type="RigidBody2D" groups=["destructible"]]
position = Vector2(-42, 74)
gravity_scale = 1.66533e-16
linear_damp = 1.0
script = ExtResource("1_bu0dg")
[node name="TextureRect" type="TextureRect" parent="."]
clip_children = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -256.0
offset_top = -256.0
offset_right = 256.0
offset_bottom = 256.0
grow_horizontal = 2
grow_vertical = 2
rotation = 1.5708
scale = Vector2(0.1, 0.1)
pivot_offset = Vector2(256, 256)
texture = ExtResource("2_cy2gs")
[node name="TextureRect" type="TextureRect" parent="TextureRect"]
layout_mode = 1
anchors_preset = 13
anchor_left = 0.5
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -1024.0
offset_right = 1024.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_xdd3j")
script = ExtResource("4_hwb8d")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
visible = false
rotation = 1.5708
scale = Vector2(0.1, 0.1)
polygon = PackedVector2Array(0, -155, 23, -147, 249, 89, 259, 113, 246, 142, 216, 155, 178, 148, 0, 52, -187, 150, -232, 148, -257, 116, -250, 89, -38, -136, -21, -147)
[node name="RayCast2D" type="RayCast2D" parent="."]
visible = false
target_position = Vector2(5000, 2.08165e-12)
[node name="Line2D" type="Line2D" parent="RayCast2D" node_paths=PackedStringArray("point_a", "point_b")]
z_index = -2
points = PackedVector2Array(0, 0, 100, 2.08165e-12)
width = 100.0
width_curve = SubResource("Curve_7ru3n")
gradient = SubResource("Gradient_l1fxo")
script = ExtResource("5_as86f")
point_a = NodePath("../..")
point_b = NodePath("../Marker2D")
[node name="Marker2D" type="Marker2D" parent="RayCast2D"]
script = ExtResource("7_6wch2")
[node name="Gun" type="Marker2D" parent="."]
visible = false
position = Vector2(53, 0)

79
project.godot Normal file
View file

@ -0,0 +1,79 @@
; 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="Countdown"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.2", "GL Compatibility")
config/icon="res://icon.svg"
[display]
window/size/viewport_width=1920
window/size/viewport_height=1080
window/stretch/mode="viewport"
[editor]
version_control/plugin_name="GitPlugin"
version_control/autoload_on_startup=true
[input]
up={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
]
}
down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
]
}
left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
]
}
right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
]
}
restart={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"echo":false,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
]
}
quare={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"echo":false,"script":null)
]
}
exagon={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
]
}
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

8
quare.gd Normal file
View file

@ -0,0 +1,8 @@
extends StaticBody2D
func destroy():
var timer = Timer.new()
if not is_queued_for_deletion():
$"../Player".aquire_quare()
queue_free()

BIN
quare.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

34
quare.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://regt4psf4pxw"
path="res://.godot/imported/quare.png-ab0056528a499e647ebe4838bd31ba15.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://quare.png"
dest_files=["res://.godot/imported/quare.png-ab0056528a499e647ebe4838bd31ba15.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

36
quare.tscn Normal file
View file

@ -0,0 +1,36 @@
[gd_scene load_steps=8 format=3 uid="uid://b2tkfnqhx5xv"]
[ext_resource type="Texture2D" uid="uid://regt4psf4pxw" path="res://quare.png" id="1_1dyuy"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_xwtag"]
[ext_resource type="Script" path="res://quare.gd" id="2_iatrf"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="2_xh8jo"]
[ext_resource type="Script" path="res://LockedRotation.gd" id="3_g8sg8"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_e1p40"]
size = Vector2(155, 155)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_uwbqk"]
gradient = ExtResource("2_xh8jo")
width = 2048
[node name="Quare" type="StaticBody2D" groups=["destructible"]]
scale = Vector2(0.5, 0.5)
physics_material_override = ExtResource("1_xwtag")
script = ExtResource("2_iatrf")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_e1p40")
script = ExtResource("3_g8sg8")
[node name="Sprite2D" type="Sprite2D" parent="."]
clip_children = 1
scale = Vector2(0.3, 0.3)
texture = ExtResource("1_1dyuy")
[node name="TextureRect" type="TextureRect" parent="Sprite2D"]
offset_left = -956.667
offset_top = -266.667
offset_right = 1091.33
offset_bottom = -226.667
scale = Vector2(1, 14.3333)
texture = SubResource("GradientTexture1D_uwbqk")

57
riangle.tscn Normal file
View file

@ -0,0 +1,57 @@
[gd_scene load_steps=6 format=3 uid="uid://yu50iyftoyaj"]
[ext_resource type="Texture2D" uid="uid://cartrcqnympin" path="res://Triangle.png" id="1_pjdof"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="2_ic6q0"]
[ext_resource type="Script" path="res://Gun.gd" id="3_kffl0"]
[ext_resource type="PackedScene" uid="uid://c6ybtahxwpukd" path="res://bullet.tscn" id="4_tfncc"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_u5oju"]
gradient = ExtResource("2_ic6q0")
width = 2048
[node name="Riangle" type="StaticBody2D" groups=["destructible"]]
scale = Vector2(0.25, 0.25)
[node name="Sprite2D" type="Sprite2D" parent="."]
clip_children = 1
rotation = 1.5708
scale = Vector2(0.5, 0.5)
texture = ExtResource("1_pjdof")
[node name="TextureRect" type="TextureRect" parent="Sprite2D"]
offset_left = -220.0
offset_top = 265.0
offset_right = 1828.0
offset_bottom = 777.0
rotation = -1.5708
texture = SubResource("GradientTexture1D_u5oju")
[node name="Gun2" type="Marker2D" parent="."]
position = Vector2(-224, 284)
rotation = 2.0944
script = ExtResource("3_kffl0")
bullet = ExtResource("4_tfncc")
[node name="Gun3" type="Marker2D" parent="."]
position = Vector2(-224, -284)
rotation = 4.18879
script = ExtResource("3_kffl0")
bullet = ExtResource("4_tfncc")
[node name="Gun" type="Marker2D" parent="."]
position = Vector2(272, 0)
script = ExtResource("3_kffl0")
bullet = ExtResource("4_tfncc")
[node name="Timer" type="Timer" parent="."]
wait_time = 2.0
autostart = true
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2(-8, 0)
polygon = PackedVector2Array(-80, -104, 100, 0, -80, 104)
[connection signal="timeout" from="Timer" to="." method="queue_free"]
[connection signal="timeout" from="Timer" to="Gun2" method="shoot"]
[connection signal="timeout" from="Timer" to="Gun3" method="shoot"]
[connection signal="timeout" from="Timer" to="Gun" method="shoot"]