Tetrominoes scripts
This commit is contained in:
parent
e50e05558f
commit
d4b29230c7
@ -29,6 +29,7 @@ var autoshift_action = ""
|
|||||||
var playing = false
|
var playing = false
|
||||||
|
|
||||||
func new_game(level):
|
func new_game(level):
|
||||||
|
$Start.visible = false
|
||||||
$Matrix/GridMap.clear()
|
$Matrix/GridMap.clear()
|
||||||
if current_piece:
|
if current_piece:
|
||||||
remove_child(current_piece)
|
remove_child(current_piece)
|
||||||
@ -38,7 +39,6 @@ func new_game(level):
|
|||||||
autoshift_action = ""
|
autoshift_action = ""
|
||||||
next_piece = random_piece()
|
next_piece = random_piece()
|
||||||
$MidiPlayer.position = 0
|
$MidiPlayer.position = 0
|
||||||
$Start.visible = false
|
|
||||||
$Stats.new_game(level)
|
$Stats.new_game(level)
|
||||||
new_piece()
|
new_piece()
|
||||||
resume()
|
resume()
|
||||||
@ -51,7 +51,6 @@ func new_piece():
|
|||||||
next_piece.translation = $Next/Position3D.translation
|
next_piece.translation = $Next/Position3D.translation
|
||||||
if current_piece.move(THERE):
|
if current_piece.move(THERE):
|
||||||
$DropTimer.start()
|
$DropTimer.start()
|
||||||
$LockDelay.start()
|
|
||||||
current_piece_held = false
|
current_piece_held = false
|
||||||
else:
|
else:
|
||||||
game_over()
|
game_over()
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
extends "Tetromino.gd"
|
extends "Tetromino.gd"
|
||||||
|
|
||||||
const CLOCKWISE = -1
|
|
||||||
const COUNTERCLOCKWISE = 1
|
|
||||||
const SUPER_ROTATION_SYSTEM = [
|
const SUPER_ROTATION_SYSTEM = [
|
||||||
{
|
{
|
||||||
COUNTERCLOCKWISE: [
|
COUNTERCLOCKWISE: [
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
extends "Tetromino.gd"
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
|||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Tetrominos/TetroJ.gd" type="Script" id=1]
|
[ext_resource path="res://Tetrominos/Tetromino.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
|
||||||
[node name="TetroJ" type="Spatial" index="0"]
|
[node name="TetroJ" type="Spatial" index="0"]
|
||||||
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
extends "Tetromino.gd"
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
|||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Tetrominos/TetroL.gd" type="Script" id=1]
|
[ext_resource path="res://Tetrominos/Tetromino.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
|
||||||
[node name="TetroL" type="Spatial" index="0"]
|
[node name="TetroL" type="Spatial" index="0"]
|
||||||
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
extends "Tetromino.gd"
|
extends "Tetromino.gd"
|
||||||
|
|
||||||
func rotate(direction):
|
func rotate(direction):
|
||||||
pass
|
return 0
|
@ -1,2 +0,0 @@
|
|||||||
extends "Tetromino.gd"
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
|||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Tetrominos/TetroS.gd" type="Script" id=1]
|
[ext_resource path="res://Tetrominos/Tetromino.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
|
||||||
[node name="TetroS" type="Spatial" index="0"]
|
[node name="TetroS" type="Spatial" index="0"]
|
||||||
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
extends "Tetromino.gd"
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
|||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Tetrominos/TetroZ.gd" type="Script" id=1]
|
[ext_resource path="res://Tetrominos/Tetromino.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
|
||||||
[node name="TetroZ" type="Spatial" index="0"]
|
[node name="TetroZ" type="Spatial" index="0"]
|
||||||
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user