-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/ligen131/ggj2024-game
- Loading branch information
Showing
9 changed files
with
141 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
extends Node2D | ||
|
||
|
||
const DynamicBgPattern = preload("res://bg/dynamic_bg/dynamic_bg_pattern/dynamic_bg_pattern.tscn") | ||
|
||
|
||
const WIDTH = 1920 / 4 | ||
const HEIGHT = 1080 / 4 | ||
|
||
const W_STEP := 60 | ||
const H_STEP := 6 | ||
|
||
var VELOCITY = 30 * Vector2.from_angle(-atan(2)) | ||
|
||
func spawn(x_offset, y_offset): | ||
var pat_x = -WIDTH + x_offset | ||
var pat_y = HEIGHT + y_offset | ||
|
||
while pat_x < WIDTH + 50: | ||
var new_pattern = DynamicBgPattern.instantiate() | ||
|
||
new_pattern.position = Vector2(pat_x, pat_y) | ||
new_pattern.velocity = VELOCITY | ||
add_child(new_pattern) | ||
|
||
pat_x += W_STEP | ||
pat_y += H_STEP | ||
|
||
|
||
func _ready(): | ||
var x_offset = 0 | ||
var y_offset = 0 | ||
while HEIGHT + y_offset + (WIDTH / W_STEP) * H_STEP > -50: | ||
spawn(x_offset, y_offset) | ||
x_offset += $Timer.wait_time * VELOCITY.x | ||
x_offset -= int(x_offset / W_STEP) * W_STEP | ||
y_offset += $Timer.wait_time * VELOCITY.y | ||
print(y_offset) | ||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta): | ||
pass | ||
|
||
|
||
func _on_timer_timeout(): | ||
spawn(0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://d3geq38s5fjc6"] | ||
|
||
[ext_resource type="Script" path="res://bg/dynamic_bg/dynamic_bg.gd" id="1_g3cph"] | ||
|
||
[node name="DynamicBg" type="Node2D"] | ||
z_index = -4096 | ||
script = ExtResource("1_g3cph") | ||
|
||
[node name="Timer" type="Timer" parent="."] | ||
wait_time = 2.0 | ||
autostart = true | ||
|
||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
extends Node2D | ||
|
||
|
||
var velocity : Vector2 | ||
|
||
|
||
func _ready(): | ||
if randi() % 2 == 1: | ||
$Word1.set_word("=*"[randi_range(0, 1)]) | ||
$Word2.set_word("DPb>"[randi_range(0, 2)]) | ||
else: | ||
$Word1.set_word("qd<"[randi_range(0, 2)]) | ||
$Word2.set_word("=*"[randi_range(0, 1)]) | ||
|
||
func _process(delta): | ||
position += velocity * delta | ||
if position.x > 1920 / 4 + 70 or position.y < -70: | ||
queue_free() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://dkm7ljv01kwma"] | ||
|
||
[ext_resource type="Script" path="res://bg/dynamic_bg/dynamic_bg_pattern/dynamic_bg_pattern.gd" id="1_hrrmh"] | ||
[ext_resource type="PackedScene" uid="uid://cvx7wowcbfo0r" path="res://objects/word/word.tscn" id="2_7jm3n"] | ||
|
||
[node name="DynamicBgPattern" type="Node2D"] | ||
modulate = Color(1, 1, 1, 0.12549) | ||
script = ExtResource("1_hrrmh") | ||
|
||
[node name="Word1" parent="." instance=ExtResource("2_7jm3n")] | ||
position = Vector2(-6, 0) | ||
|
||
[node name="Word2" parent="." instance=ExtResource("2_7jm3n")] | ||
position = Vector2(6, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://c17fbsiogbgo1"] | ||
[gd_scene load_steps=3 format=3 uid="uid://c17fbsiogbgo1"] | ||
|
||
[ext_resource type="PackedScene" uid="uid://c07co5p46apu7" path="res://objects/main_menu/main_menu.tscn" id="1_fk6j6"] | ||
[ext_resource type="PackedScene" uid="uid://d3geq38s5fjc6" path="res://bg/dynamic_bg/dynamic_bg.tscn" id="2_8k4il"] | ||
|
||
[node name="Main" type="Node"] | ||
|
||
[node name="MainMenu" parent="." instance=ExtResource("1_fk6j6")] | ||
|
||
[node name="Bg" type="Node" parent="."] | ||
|
||
[node name="DynamicBg" parent="Bg" instance=ExtResource("2_8k4il")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://cdu8yubd7fyvb"] | ||
|
||
[ext_resource type="FontFile" uid="uid://1000owdyvwfg" path="res://fonts/unifont-15.1.04.otf" id="1_re7ax"] | ||
|
||
[node name="Label" type="Label"] | ||
custom_minimum_size = Vector2(480, 256) | ||
offset_right = 40.0 | ||
offset_bottom = 23.0 | ||
theme_override_fonts/font = ExtResource("1_re7ax") | ||
text = " | ||
[ Equal to P ] | ||
Created by 玩一个四字音游导致的 @ GGJ2024 | ||
ligen131 Tsukimaru | ||
Bunnycxk IssactheMouse | ||
THANKS FOR PLAYING! ;-)" | ||
horizontal_alignment = 1 |