reorganization
@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/16.png-f3b4844aade9b270cbb38cff295ce33e.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icons/16.png"
|
||||
dest_files=[ "res://.import/16.png-f3b4844aade9b270cbb38cff295ce33e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/256.png-9a56a9319a91fa74ee7ddb5c0b84a228.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icons/256.png"
|
||||
dest_files=[ "res://.import/256.png-9a56a9319a91fa74ee7ddb5c0b84a228.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/32.png-2c676109efa1e249139d639d1746eda5.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icons/32.png"
|
||||
dest_files=[ "res://.import/32.png-2c676109efa1e249139d639d1746eda5.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
@ -1,29 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/48.png-477be3215ba369c304be5535b6005c78.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icons/48.png"
|
||||
dest_files=[ "res://.import/48.png-477be3215ba369c304be5535b6005c78.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
@ -18,7 +18,7 @@ const HOLD_POSITION = Vector3(-5, 16, 0)
|
||||
const movements = {
|
||||
"move_right": Vector3(1, 0, 0),
|
||||
"move_left": Vector3(-1, 0, 0),
|
||||
"drop": Vector3(0, -1, 0)
|
||||
"soft_drop": Vector3(0, -1, 0)
|
||||
}
|
||||
|
||||
var random_bag = []
|
||||
@ -70,12 +70,12 @@ func new_piece():
|
||||
autoshift_action = ""
|
||||
next_piece = random_piece()
|
||||
next_piece.translation = NEXT_POSITION
|
||||
if move(movements["drop"]):
|
||||
if move(movements["soft_drop"]):
|
||||
$DropTimer.start()
|
||||
$LockDelay.start()
|
||||
current_piece_held = false
|
||||
else:
|
||||
current_piece.translate(movements["drop"])
|
||||
current_piece.translate(movements["soft_drop"])
|
||||
game_over()
|
||||
|
||||
func random_piece():
|
||||
@ -120,11 +120,9 @@ func _process(delta):
|
||||
if Input.is_action_just_pressed("hard_drop"):
|
||||
hard_drop()
|
||||
if Input.is_action_just_pressed("rotate_clockwise"):
|
||||
if rotate(Tetromino.CLOCKWISE):
|
||||
$MidiPlayer.move()
|
||||
rotate(Tetromino.CLOCKWISE)
|
||||
if Input.is_action_just_pressed("rotate_counterclockwise"):
|
||||
if rotate(Tetromino.COUNTERCLOCKWISE):
|
||||
$MidiPlayer.move()
|
||||
rotate(Tetromino.COUNTERCLOCKWISE)
|
||||
if Input.is_action_just_pressed("hold"):
|
||||
hold()
|
||||
|
||||
@ -139,14 +137,12 @@ func _on_AutoShiftTimer_timeout():
|
||||
|
||||
func process_autoshift_action():
|
||||
if move(movements[autoshift_action]):
|
||||
$MidiPlayer.move()
|
||||
if autoshift_action == "drop":
|
||||
if autoshift_action == "soft_drop":
|
||||
emit_signal("piece_dropped", 1)
|
||||
|
||||
func hard_drop():
|
||||
$MidiPlayer.move()
|
||||
var score = 0
|
||||
while move(movements["drop"]):
|
||||
while move(movements["soft_drop"]):
|
||||
score += 2
|
||||
emit_signal("piece_dropped", score)
|
||||
lock()
|
||||
@ -166,10 +162,10 @@ func rotate(direction):
|
||||
return false
|
||||
|
||||
func _on_DropTimer_timeout():
|
||||
move(movements["drop"])
|
||||
move(movements["soft_drop"])
|
||||
|
||||
func _on_LockDelay_timeout():
|
||||
if not move(movements["drop"]):
|
||||
if not move(movements["soft_drop"]):
|
||||
lock()
|
||||
|
||||
func lock():
|
@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=21 format=2]
|
||||
|
||||
[ext_resource path="res://starmap_g4k_print.jpg" type="Texture" id=1]
|
||||
[ext_resource path="res://Main.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Main.gd" type="Script" id=1]
|
||||
[ext_resource path="res://night-sky-background-14391263141jp.jpg" type="Texture" id=2]
|
||||
[ext_resource path="res://Tetrominos/Mino/MinoLibrary.tres" type="MeshLibrary" id=3]
|
||||
[ext_resource path="res://GridMap.gd" type="Script" id=4]
|
||||
[ext_resource path="res://midi/MidiPlayer.tscn" type="PackedScene" id=5]
|
||||
@ -16,19 +16,18 @@
|
||||
[sub_resource type="PanoramaSky" id=1]
|
||||
|
||||
radiance_size = 0
|
||||
panorama = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="Environment" id=2]
|
||||
|
||||
resource_local_to_scene = true
|
||||
background_mode = 2
|
||||
background_mode = 0
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_custom_fov = 0.0
|
||||
background_color = Color( 0.409546, 0.764489, 0.859375, 1 )
|
||||
background_energy = 1.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 0.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0.794922, 0.978371, 1, 1 )
|
||||
ambient_light_energy = 16.0
|
||||
ambient_light_color = Color( 0.86908, 0.949502, 0.958984, 1 )
|
||||
ambient_light_energy = 2.0
|
||||
ambient_light_sky_contribution = 0.92
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
@ -230,14 +229,46 @@ extra_spacing_bottom = 5
|
||||
font_data = ExtResource( 11 )
|
||||
_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ]
|
||||
|
||||
[node name="Main" type="WorldEnvironment"]
|
||||
[node name="Main" type="WorldEnvironment" index="0"]
|
||||
|
||||
environment = SubResource( 2 )
|
||||
script = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="." index="0"]
|
||||
[node name="Sprite3D" type="Sprite3D" parent="." index="0"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 10, 12 )
|
||||
transform = Transform( 19.2, 0, 0, 0, 12.8, 0, 0, 0, 1, 5, 10, -80 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
centered = true
|
||||
offset = Vector2( 0, 0 )
|
||||
flip_h = false
|
||||
flip_v = false
|
||||
modulate = Color( 0.478431, 0.478431, 0.478431, 1 )
|
||||
opacity = 0.0
|
||||
pixel_size = 0.01
|
||||
axis = 2
|
||||
transparent = false
|
||||
shaded = false
|
||||
double_sided = false
|
||||
alpha_cut = 0
|
||||
texture = ExtResource( 2 )
|
||||
vframes = 1
|
||||
hframes = 1
|
||||
frame = 0
|
||||
region_enabled = false
|
||||
region_rect = Rect2( 0, 0, 0, 0 )
|
||||
_sections_unfolded = [ "Animation", "Flags", "Transform" ]
|
||||
|
||||
[node name="Camera" type="Camera" parent="." index="1"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 10, 20 )
|
||||
keep_aspect = 1
|
||||
cull_mask = 1048575
|
||||
environment = null
|
||||
@ -246,15 +277,15 @@ v_offset = 0.0
|
||||
doppler_tracking = 0
|
||||
projection = 0
|
||||
current = true
|
||||
fov = 100.0
|
||||
fov = 70.0
|
||||
size = 1.0
|
||||
near = 0.05
|
||||
far = -1.22275e+007
|
||||
near = 0.1
|
||||
far = 1.29056e+006
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="." index="1"]
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="." index="2"]
|
||||
|
||||
transform = Transform( 0.332668, 0.771982, -0.541642, 0.579657, 0.285656, 0.763151, 0.743861, -0.567843, -0.352456, 2.01163, 29.4451, 0 )
|
||||
transform = Transform( 0.332668, 0.771982, -0.541642, 0.579657, 0.285656, 0.763151, 0.743861, -0.567843, -0.352456, 5, 30, 0 )
|
||||
layers = 1
|
||||
light_color = Color( 1, 1, 1, 1 )
|
||||
light_energy = 3.0
|
||||
@ -280,7 +311,7 @@ directional_shadow_depth_range = 0
|
||||
directional_shadow_max_distance = 200.0
|
||||
_sections_unfolded = [ "Light", "Transform" ]
|
||||
|
||||
[node name="GridMap" type="GridMap" parent="." index="2"]
|
||||
[node name="GridMap" type="GridMap" parent="." index="3"]
|
||||
|
||||
theme = ExtResource( 3 )
|
||||
cell_size = Vector3( 1, 1, 1 )
|
||||
@ -303,8 +334,9 @@ __meta__ = {
|
||||
NB_LINES = 20
|
||||
NB_COLLUMNS = 10
|
||||
|
||||
[node name="Backs" type="Spatial" parent="." index="3"]
|
||||
[node name="Backs" type="Spatial" parent="." index="4"]
|
||||
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
|
||||
[node name="GridBack" type="MeshInstance" parent="Backs" index="0"]
|
||||
@ -358,36 +390,37 @@ skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="DropTimer" type="Timer" parent="." index="4"]
|
||||
[node name="DropTimer" type="Timer" parent="." index="5"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 1.0
|
||||
one_shot = false
|
||||
autostart = false
|
||||
|
||||
[node name="LockDelay" type="Timer" parent="." index="5"]
|
||||
[node name="LockDelay" type="Timer" parent="." index="6"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.5
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="AutoShiftDelay" type="Timer" parent="." index="6"]
|
||||
[node name="AutoShiftDelay" type="Timer" parent="." index="7"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.17
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="AutoShiftTimer" type="Timer" parent="." index="7"]
|
||||
[node name="AutoShiftTimer" type="Timer" parent="." index="8"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.03
|
||||
one_shot = false
|
||||
autostart = false
|
||||
|
||||
[node name="MidiPlayer" parent="." index="8" instance=ExtResource( 5 )]
|
||||
[node name="MidiPlayer" parent="." index="9" instance=ExtResource( 5 )]
|
||||
|
||||
editor/display_folded = true
|
||||
script = ExtResource( 6 )
|
||||
file = "res://midi/Tetris - Song A.mid"
|
||||
volume_db = -12
|
||||
@ -402,7 +435,7 @@ wait_time = 1.41
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="FlashText" type="Control" parent="." index="9"]
|
||||
[node name="FlashText" type="Control" parent="." index="10"]
|
||||
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
@ -456,15 +489,15 @@ anims/Flash = SubResource( 7 )
|
||||
blend_times = [ ]
|
||||
_sections_unfolded = [ "Playback Options" ]
|
||||
|
||||
[node name="Stats" parent="." index="10" instance=ExtResource( 9 )]
|
||||
[node name="Stats" parent="." index="11" instance=ExtResource( 9 )]
|
||||
|
||||
visible = false
|
||||
|
||||
[node name="controls_ui" parent="." index="11" instance=ExtResource( 10 )]
|
||||
[node name="controls_ui" parent="." index="12" instance=ExtResource( 10 )]
|
||||
|
||||
visible = false
|
||||
|
||||
[node name="ReplayButton" type="Button" parent="." index="12"]
|
||||
[node name="ReplayButton" type="Button" parent="." index="13"]
|
||||
|
||||
visible = false
|
||||
anchor_left = 1.0
|
||||
@ -493,7 +526,7 @@ flat = false
|
||||
align = 1
|
||||
_sections_unfolded = [ "Margin", "custom_colors", "custom_fonts" ]
|
||||
|
||||
[node name="Start" parent="." index="13" instance=ExtResource( 12 )]
|
||||
[node name="Start" parent="." index="14" instance=ExtResource( 12 )]
|
||||
|
||||
[connection signal="piece_dropped" from="." to="Stats" method="_on_Main_piece_dropped"]
|
||||
|
@ -3,12 +3,11 @@ extends "midi/MidiPlayer.gd"
|
||||
const Tetromino = preload("res://Tetrominos/Tetromino.gd")
|
||||
|
||||
const LINE_CLEAR_CHANNELS = [2, 6]
|
||||
const MOVE_CHANNELS = []
|
||||
|
||||
var muted_events = []
|
||||
|
||||
func _ready():
|
||||
mute_channels(MOVE_CHANNELS+LINE_CLEAR_CHANNELS)
|
||||
mute_channels(LINE_CLEAR_CHANNELS)
|
||||
|
||||
func _init_channel( ):
|
||||
._init_channel()
|
||||
@ -37,10 +36,6 @@ func unmute_channels(channels):
|
||||
for note in muted_events[channel_id]:
|
||||
_process_track_event_note_on(channel_status[channel_id], muted_events[channel_id][note])
|
||||
|
||||
func move():
|
||||
unmute_channels(MOVE_CHANNELS)
|
||||
mute_channels(MOVE_CHANNELS)
|
||||
|
||||
func _on_Main_piece_locked(lines, t_spin):
|
||||
if lines or t_spin:
|
||||
if lines == Tetromino.NB_MINOES:
|
@ -162,7 +162,7 @@ subdivide_width = 0
|
||||
subdivide_height = 0
|
||||
subdivide_depth = 0
|
||||
|
||||
[node name="Mino" type="Spatial" index="0"]
|
||||
[node name="Mino" type="Spatial"]
|
||||
|
||||
transform = Transform( 0.997027, 0, 0, 0, 0.997027, 0, 0, 0, 0.997027, 0, 0, 0 )
|
||||
_sections_unfolded = [ "Pause", "Transform", "Visibility" ]
|
@ -122,10 +122,10 @@ func rotate(direction):
|
||||
return i+1
|
||||
return 0
|
||||
|
||||
func emit_trail(emit):
|
||||
func emit_trail(visible):
|
||||
var trail
|
||||
for mino in minoes:
|
||||
trail = mino.get_node("Trail")
|
||||
trail.emitting = emit
|
||||
trail.restart()
|
||||
mino.get_node("SpotLight").visible = emit
|
||||
trail.emitting = visible
|
||||
trail.visible = visible
|
||||
mino.get_node("SpotLight").visible = visible
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 384 B |
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 211 KiB |
BIN
source/night-sky-background-14391263141jp.jpg
Normal file
After Width: | Height: | Size: 587 KiB |
@ -51,5 +51,4 @@ toggle_fullscreen=[ Object(InputEventKey,"resource_local_to_scene":false,"resour
|
||||
|
||||
[rendering]
|
||||
|
||||
threads/thread_model=2
|
||||
environment/default_clear_color=Color( 0, 0, 0, 1 )
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 126 KiB |
BIN
web/favicon.ico
Normal file
After Width: | Height: | Size: 208 B |