loading udpate

This commit is contained in:
Ultrablob 2024-04-19 17:59:19 -04:00
parent 6c8bfd4ec0
commit bf16dfe508
18 changed files with 467 additions and 205 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -11,11 +11,10 @@ func _physics_process(delta):
if get_last_slide_collision():
var collision: KinematicCollision2D = get_last_slide_collision()
if collision.get_collider() and collision.get_collider().name == "Bullet":
print(collision.get_collider().name)
collision.get_collider().queue_free()
if collision.get_collider():
elif collision.get_collider():
hit(collision.get_collider())
velocity = velocity.bounce(clamp_to_1bit(collision.get_normal()))
velocity = velocity.bounce(clamp_to_1bit(collision.get_normal()))
move_and_slide()

View file

@ -1,7 +1,8 @@
extends ShapeCast2D
func is_clear(area: Vector2):
func is_clear(area: Vector2, radius=100):
position = area
shape.radius = radius
force_shapecast_update()
return get_collision_count() == 0

BIN
Kenney Future.ttf Normal file

Binary file not shown.

View file

@ -2,20 +2,20 @@
importer="font_data_dynamic"
type="FontFile"
uid="uid://ve8css0g3ldb"
path="res://.godot/imported/Preahvihear-Regular.ttf-fe12a5de018003b711dd7856f0e35e17.fontdata"
uid="uid://bnguin7bsyx6e"
path="res://.godot/imported/Kenney Future.ttf-fd1f813a9c064cd591bf3582d7978539.fontdata"
[deps]
source_file="res://Preahvihear/Preahvihear-Regular.ttf"
dest_files=["res://.godot/imported/Preahvihear-Regular.ttf-fe12a5de018003b711dd7856f0e35e17.fontdata"]
source_file="res://Kenney Future.ttf"
dest_files=["res://.godot/imported/Kenney Future.ttf-fd1f813a9c064cd591bf3582d7978539.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
@ -26,7 +26,7 @@ oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=false
compress=true
preload=[]
language_support={}
script_support={}

View file

@ -1,9 +1,9 @@
extends Label
extends RichTextLabel
@export var stopwatch: Stopwatch
var config = ConfigFile.new()
var API_BASE = "https://flask-hello-world-nine-psi.vercel.app" if not OS.is_debug_build() else "http://192.168.2.120:5001"
var API_BASE = "https://flask-hello-world-nine-psi.vercel.app"
func make_urlsafe(data: String):
return data.replace("+", "-").replace("/", "_")
@ -31,19 +31,19 @@ func _on_request_completed(result, response_code, headers, body):
var scores = []
for score in scoredata:
scores.append(float(score[1]))
print(scores)
#print(scores)
var score = stopwatch.time_elapsed
print(score)
#print(score)
var placement = closest(score, scores)
print(placement)
#print(placement)
if placement < 50:
text = "You placed #%d\n" % [placement]
text = "[center]You placed #%d\n[/center]" % [placement]
else:
text = "You placed top %d%%\n" % [(float(placement) / len(scores)) * 100]
text = "[center]You placed top %d%%\n[/center]" % [(float(placement) / len(scores)) * 100]
var n = 1
while n <= 5 and n <= len(scores):
text += "%d. %s: %s\n" % [ n, scoredata[n-1][0], seconds2mmss(scores[n-1]) ]
while n <= 50 and n <= len(scores):
text += "%d.\t\t%s:\t\t%s\n" % [ n, scoredata[n-1][0], seconds2mmss(scores[n-1]) ]
n += 1
func closest(my_number:int, my_array:Array)->int:

View file

@ -1,13 +1,22 @@
extends Control
const MAIN_SCENE_PATH = "res://main.tscn"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
$Layout/Play.disabled = true
ResourceLoader.load_threaded_request(MAIN_SCENE_PATH)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
var porgres = []
var progress = ResourceLoader.load_threaded_get_status(MAIN_SCENE_PATH, porgres)
$Layout/Play.text = "Play (%d%%)" % [clampf(remap(porgres[0], 0.46, 0.5, 0, 100), 0, 100)]
if progress == ResourceLoader.THREAD_LOAD_LOADED:
$Layout/Play.disabled = false
$Layout/Play.text = "Play"
func play():
get_tree().change_scene_to_file("res://main.tscn")
var game = ResourceLoader.load_threaded_get(MAIN_SCENE_PATH)
get_tree().change_scene_to_packed(game)

View file

@ -53,7 +53,7 @@ func _input(event):
notifier.notify("All Quares in Use!")
return
if not $"../CollisionCheck".is_clear(get_global_mouse_position()):
if not $"../CollisionCheck".is_clear(get_global_mouse_position(), 60):
$"../CollisionCheck".flash()
notifier.notify("Too Close!")
return

View file

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

@ -5,7 +5,7 @@ var config = ConfigFile.new()
func _ready():
var has_config = config.load("user://settings.cfg") == OK
print(has_config)
$"../Play".disabled = not has_config
$"../Layout/Play".disabled = not has_config
if has_config:
$Menu/Username.text = config.get_value("config", "username")
$Menu/Controls.selected = 0 if config.get_value("config", "relative_controls") else 1
@ -22,4 +22,4 @@ func save():
print("Saving!")
config.save("user://settings.cfg")
$"../Play".disabled = false
$"../Layout/Play".disabled = false

View file

@ -2,13 +2,14 @@ extends Marker2D
@export var item: PackedScene
@export var random_on_screen = false
@export var radius = 100
func spawn():
if get_tree().paused:
return
for i in range(10):
var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080)
if not $"../CollisionCheck".is_clear(test_pos):
if not $"../CollisionCheck".is_clear(test_pos, radius):
continue
var node = item.instantiate()
node.global_position = test_pos

View file

@ -1,8 +0,0 @@
extends Label
func show():
show()
visible = true
func hide():
visible = false

BIN
background space.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

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

View file

@ -2,4 +2,3 @@
[resource]
friction = 0.0
bounce = 1.0

383
main.tscn

File diff suppressed because one or more lines are too long

View file

@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://MainMenu.gd" id="1_omrmt"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="2_fq3us"]
[ext_resource type="Script" path="res://InfiniteGradient.gd" id="3_7u2sq"]
[ext_resource type="FontFile" uid="uid://ve8css0g3ldb" path="res://Preahvihear/Preahvihear-Regular.ttf" id="3_swfwl"]
[ext_resource type="FontFile" uid="uid://bnguin7bsyx6e" path="res://Kenney Future.ttf" id="4_ybv7t"]
[ext_resource type="Script" path="res://Settings.gd" id="5_sarwv"]
[ext_resource type="Script" path="res://EmojiValidator.gd" id="6_ojb71"]
@ -44,64 +44,49 @@ offset_top = -539.0
offset_bottom = 4.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 200
text = "Quare Game"
horizontal_alignment = 1
[node name="Settings" type="Button" parent="."]
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchors_preset = 12
anchor_top = 1.0
anchor_right = 0.5
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -934.0
offset_top = -326.0
offset_right = -414.0
offset_bottom = -136.0
offset_top = -450.0
offset_bottom = -79.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("3_swfwl")
alignment = 1
[node name="Play" type="Button" parent="Layout"]
layout_mode = 2
size_flags_horizontal = 4
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 100
text = "PLAY"
flat = true
[node name="Settings" type="Button" parent="Layout"]
layout_mode = 2
size_flags_horizontal = 4
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 100
text = "CONFIG"
flat = true
alignment = 0
[node name="Tutorial" type="Button" parent="."]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = 353.0
offset_top = -327.0
offset_right = 873.0
offset_bottom = -137.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("3_swfwl")
[node name="Tutorial" type="Button" parent="Layout"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 100
text = "TUTORIAL"
flat = true
[node name="Play" type="Button" parent="."]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -173.0
offset_top = -326.0
offset_right = 173.0
offset_bottom = -136.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_font_sizes/font_size = 100
text = " PLAY "
flat = true
alignment = 2
[node name="Settings Panel" type="ColorRect" parent="."]
visible = false
@ -127,7 +112,7 @@ offset_right = 72.0
offset_bottom = -59.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 50
text = "SAVE"
flat = true
@ -149,6 +134,7 @@ columns = 2
[node name="Label" type="Label" parent="Settings Panel/Menu"]
layout_mode = 2
size_flags_horizontal = 0
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 80
text = "Username"
@ -156,7 +142,7 @@ text = "Username"
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
size_flags_horizontal = 8
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 54
placeholder_text = "USR"
alignment = 1
@ -167,12 +153,13 @@ pattern = "^[A-Za-z]+"
[node name="Label2" type="Label" parent="Settings Panel/Menu"]
layout_mode = 2
size_flags_horizontal = 0
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 80
text = "Movement "
[node name="Controls" type="OptionButton" parent="Settings Panel/Menu"]
layout_mode = 2
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 54
item_count = 2
selected = 0
@ -190,10 +177,8 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 64
text = "You are gaming
kill you're self"
horizontal_alignment = 1
vertical_alignment = 1
@ -213,14 +198,14 @@ offset_left = 24.0
offset_top = 6.0
offset_right = 63.0
offset_bottom = 106.0
theme_override_fonts/font = ExtResource("3_swfwl")
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 50
text = "X"
flat = true
[connection signal="pressed" from="Settings" to="Settings Panel" method="show"]
[connection signal="pressed" from="Tutorial" to="Tutorial Text" method="show"]
[connection signal="pressed" from="Play" to="." method="play"]
[connection signal="pressed" from="Layout/Play" to="." method="play"]
[connection signal="pressed" from="Layout/Settings" to="Settings Panel" method="show"]
[connection signal="pressed" from="Layout/Tutorial" to="Tutorial Text" method="show"]
[connection signal="pressed" from="Settings Panel/Close" to="Settings Panel" method="save"]
[connection signal="pressed" from="Settings Panel/Close" to="Settings Panel" method="hide"]
[connection signal="text_changed" from="Settings Panel/Menu/Username" to="Settings Panel" method="check_valid"]