commit
b1a4e83b91
14 changed files with 269 additions and 0 deletions
-
11.gitignore
-
9Block.tscn
-
39GameBoard.gd
-
19GameBoard.tscn
-
8Main.tscn
-
17ShapeSquare.tscn
-
BINbackground.png
-
35background.png.import
-
BINbrick.png
-
35brick.png.import
-
7default_env.tres
-
BINicon.png
-
35icon.png.import
-
54project.godot
@ -0,0 +1,11 @@ |
|||
# Godot-specific ignores |
|||
.import/ |
|||
export.cfg |
|||
export_presets.cfg |
|||
|
|||
# Imported translations (automatically generated from CSV files) |
|||
*.translation |
|||
|
|||
# Mono-specific ignores |
|||
.mono/ |
|||
data_*/ |
@ -0,0 +1,9 @@ |
|||
[gd_scene load_steps=2 format=2] |
|||
|
|||
[ext_resource path="res://brick.png" type="Texture" id=1] |
|||
|
|||
[node name="Block" type="Node2D"] |
|||
|
|||
[node name="Sprite" type="Sprite" parent="."] |
|||
scale = Vector2( 0.125, 0.125 ) |
|||
texture = ExtResource( 1 ) |
@ -0,0 +1,39 @@ |
|||
extends Node2D |
|||
|
|||
|
|||
onready var active_shape: Node2D = $ShapeSquare |
|||
|
|||
const RASTER_SIZE = 64 |
|||
|
|||
|
|||
func _ready(): |
|||
$GravityTimer.connect("timeout", self, "update_board") |
|||
|
|||
|
|||
func update_board(): |
|||
if active_shape.position.y == RASTER_SIZE * 9: |
|||
# TODO: Turn into static blocks |
|||
return |
|||
|
|||
active_shape.position.y += RASTER_SIZE |
|||
|
|||
|
|||
func move_left(): |
|||
# TODO: Check for collision |
|||
active_shape.position.x -= RASTER_SIZE |
|||
|
|||
|
|||
func move_right(): |
|||
# TODO: Check for collision |
|||
active_shape.position.x += RASTER_SIZE |
|||
|
|||
|
|||
func _input(event): |
|||
if event.is_action_pressed("move_left"): |
|||
move_left() |
|||
elif event.is_action_pressed("move_right"): |
|||
move_right() |
|||
elif event.is_action_pressed("rotate"): |
|||
pass |
|||
elif event.is_action_pressed("drop"): |
|||
pass |
@ -0,0 +1,19 @@ |
|||
[gd_scene load_steps=4 format=2] |
|||
|
|||
[ext_resource path="res://background.png" type="Texture" id=1] |
|||
[ext_resource path="res://GameBoard.gd" type="Script" id=2] |
|||
[ext_resource path="res://ShapeSquare.tscn" type="PackedScene" id=3] |
|||
|
|||
[node name="GameBoard" type="Node2D"] |
|||
script = ExtResource( 2 ) |
|||
|
|||
[node name="Sprite" type="Sprite" parent="."] |
|||
scale = Vector2( 1.25, 1.25 ) |
|||
texture = ExtResource( 1 ) |
|||
|
|||
[node name="GravityTimer" type="Timer" parent="."] |
|||
process_mode = 0 |
|||
wait_time = 0.5 |
|||
autostart = true |
|||
|
|||
[node name="ShapeSquare" parent="." instance=ExtResource( 3 )] |
@ -0,0 +1,8 @@ |
|||
[gd_scene load_steps=2 format=2] |
|||
|
|||
[ext_resource path="res://GameBoard.tscn" type="PackedScene" id=1] |
|||
|
|||
[node name="Main" type="Node2D"] |
|||
|
|||
[node name="GameBoard" parent="." instance=ExtResource( 1 )] |
|||
position = Vector2( 547, 813 ) |
@ -0,0 +1,17 @@ |
|||
[gd_scene load_steps=2 format=2] |
|||
|
|||
[ext_resource path="res://Block.tscn" type="PackedScene" id=1] |
|||
|
|||
[node name="ShapeSquare" type="Node2D"] |
|||
|
|||
[node name="Block" parent="." instance=ExtResource( 1 )] |
|||
position = Vector2( 32, 32 ) |
|||
|
|||
[node name="Block2" parent="." instance=ExtResource( 1 )] |
|||
position = Vector2( 32, -32 ) |
|||
|
|||
[node name="Block3" parent="." instance=ExtResource( 1 )] |
|||
position = Vector2( -32, -32 ) |
|||
|
|||
[node name="Block4" parent="." instance=ExtResource( 1 )] |
|||
position = Vector2( -32, 32 ) |
After Width: 512 | Height: 1024 | Size: 3.3 KiB |
@ -0,0 +1,35 @@ |
|||
[remap] |
|||
|
|||
importer="texture" |
|||
type="StreamTexture" |
|||
path="res://.import/background.png-98289422cd7d93003950872a7b97021f.stex" |
|||
metadata={ |
|||
"vram_texture": false |
|||
} |
|||
|
|||
[deps] |
|||
|
|||
source_file="res://background.png" |
|||
dest_files=[ "res://.import/background.png-98289422cd7d93003950872a7b97021f.stex" ] |
|||
|
|||
[params] |
|||
|
|||
compress/mode=0 |
|||
compress/lossy_quality=0.7 |
|||
compress/hdr_mode=0 |
|||
compress/bptc_ldr=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 |
|||
process/invert_color=false |
|||
process/normal_map_invert_y=false |
|||
stream=false |
|||
size_limit=0 |
|||
detect_3d=true |
|||
svg/scale=1.0 |
After Width: 512 | Height: 512 | Size: 6.2 KiB |
@ -0,0 +1,35 @@ |
|||
[remap] |
|||
|
|||
importer="texture" |
|||
type="StreamTexture" |
|||
path="res://.import/brick.png-3b7e2d2d29430a475fb75656e3e81471.stex" |
|||
metadata={ |
|||
"vram_texture": false |
|||
} |
|||
|
|||
[deps] |
|||
|
|||
source_file="res://brick.png" |
|||
dest_files=[ "res://.import/brick.png-3b7e2d2d29430a475fb75656e3e81471.stex" ] |
|||
|
|||
[params] |
|||
|
|||
compress/mode=0 |
|||
compress/lossy_quality=0.7 |
|||
compress/hdr_mode=0 |
|||
compress/bptc_ldr=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 |
|||
process/invert_color=false |
|||
process/normal_map_invert_y=false |
|||
stream=false |
|||
size_limit=0 |
|||
detect_3d=true |
|||
svg/scale=1.0 |
@ -0,0 +1,7 @@ |
|||
[gd_resource type="Environment" load_steps=2 format=2] |
|||
|
|||
[sub_resource type="ProceduralSky" id=1] |
|||
|
|||
[resource] |
|||
background_mode = 2 |
|||
background_sky = SubResource( 1 ) |
After Width: 64 | Height: 64 | Size: 3.2 KiB |
@ -0,0 +1,35 @@ |
|||
[remap] |
|||
|
|||
importer="texture" |
|||
type="StreamTexture" |
|||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" |
|||
metadata={ |
|||
"vram_texture": false |
|||
} |
|||
|
|||
[deps] |
|||
|
|||
source_file="res://icon.png" |
|||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] |
|||
|
|||
[params] |
|||
|
|||
compress/mode=0 |
|||
compress/lossy_quality=0.7 |
|||
compress/hdr_mode=0 |
|||
compress/bptc_ldr=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 |
|||
process/invert_color=false |
|||
process/normal_map_invert_y=false |
|||
stream=false |
|||
size_limit=0 |
|||
detect_3d=true |
|||
svg/scale=1.0 |
@ -0,0 +1,54 @@ |
|||
; 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=4 |
|||
|
|||
[application] |
|||
|
|||
config/name="Tetris" |
|||
run/main_scene="res://Main.tscn" |
|||
config/icon="res://icon.png" |
|||
|
|||
[display] |
|||
|
|||
window/size/width=1080 |
|||
window/size/height=1920 |
|||
window/size/test_width=576 |
|||
window/size/test_height=1024 |
|||
window/stretch/mode="2d" |
|||
|
|||
[input] |
|||
|
|||
move_left={ |
|||
"deadzone": 0.5, |
|||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) |
|||
] |
|||
} |
|||
move_right={ |
|||
"deadzone": 0.5, |
|||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) |
|||
] |
|||
} |
|||
rotate={ |
|||
"deadzone": 0.5, |
|||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) |
|||
] |
|||
} |
|||
drop={ |
|||
"deadzone": 0.5, |
|||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) |
|||
] |
|||
} |
|||
|
|||
[physics] |
|||
|
|||
common/enable_pause_aware_picking=true |
|||
|
|||
[rendering] |
|||
|
|||
environment/default_environment="res://default_env.tres" |
Write
Preview
Loading…
Cancel
Save
Reference in new issue