been working on procedural board system

updated size of plank
changed plank and cinderblock import options to not filter
master
Zachary Epps 4 years ago
parent 78abb2adba
commit a5b62b66f1
  1. 83
      Game.tscn
  2. 2
      Sprites/Cinderblock.png.import
  3. BIN
      Sprites/Plank.png
  4. 2
      Sprites/Plank.png.import
  5. 1
      project.godot
  6. 13
      scenes/BreakableObj.tscn
  7. 1
      scripts/BreakableObj.gd
  8. 9
      scripts/Game.gd
  9. 3
      scripts/ParticleEmitter.gd

@ -1,9 +1,9 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://scripts/Game.gd" type="Script" id=1]
[ext_resource path="res://scenes/InGameUI.tscn" type="PackedScene" id=2]
[ext_resource path="res://Sprites/Cinderblock.png" type="Texture" id=3]
[ext_resource path="res://Sprites/Plank.png" type="Texture" id=4]
[ext_resource path="res://Sprites/Plank.png" type="Texture" id=2]
[ext_resource path="res://scenes/InGameUI.tscn" type="PackedScene" id=3]
[ext_resource path="res://Sprites/Cinderblock.png" type="Texture" id=4]
[ext_resource path="res://scenes/Emitter.tscn" type="PackedScene" id=5]
[ext_resource path="res://textures/one_plus.png" type="Texture" id=6]
@ -19,34 +19,13 @@ __meta__ = {
"_edit_horizontal_guides_": [ 659.892, 919.302 ],
"_edit_vertical_guides_": [ 70.6318, 556.276 ]
}
board_cnt = 1
time_limit = 5.0
[node name="InGameUI" parent="." index="0" instance=ExtResource( 2 )]
scale = Vector2( 1, 1 )
transform = Transform2D( 1, 0, 0, 1, 0, 0 )
[node name="Blocks" type="Node2D" parent="." index="1"]
editor/display_folded = true
[node name="Cinderblock" type="Sprite" parent="Blocks" index="0"]
position = Vector2( 134.992, 588.018 )
scale = Vector2( 0.13, 0.13 )
texture = ExtResource( 3 )
_sections_unfolded = [ "Transform" ]
[node name="Cinderblock2" type="Sprite" parent="Blocks" index="1"]
position = Vector2( 483.187, 588.018 )
scale = Vector2( 0.13, 0.13 )
texture = ExtResource( 3 )
_sections_unfolded = [ "Transform" ]
[node name="Area2D" type="Area2D" parent="." index="2"]
[node name="Area2D" type="Area2D" parent="." index="0"]
editor/display_folded = true
visible = false
position = Vector2( 310, 560 )
scale = Vector2( 7.58819, 4.05328 )
input_pickable = true
@ -57,22 +36,58 @@ angular_damp = 1.0
audio_bus_override = false
audio_bus_name = "Master"
_sections_unfolded = [ "Collision", "Visibility" ]
__meta__ = {
"_edit_group_": true
}
[node name="Plank" type="Sprite" parent="Area2D" index="0"]
position = Vector2( 0, -14.132 )
scale = Vector2( 0.02, 0.035 )
texture = ExtResource( 4 )
scale = Vector2( 0.079791, 0.139634 )
texture = ExtResource( 2 )
_sections_unfolded = [ "Transform" ]
[node name="Plank2" type="Sprite" parent="Area2D" index="1"]
position = Vector2( -1.31784, -19.7371 )
scale = Vector2( 0.079791, 0.139634 )
texture = ExtResource( 2 )
_sections_unfolded = [ "Transform" ]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" index="1"]
[node name="Plank3" type="Sprite" parent="Area2D" index="2"]
position = Vector2( 0, -24.6714 )
scale = Vector2( 0.0797909, 0.139634 )
texture = ExtResource( 2 )
_sections_unfolded = [ "Transform" ]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" index="3"]
visible = false
position = Vector2( 0.0839996, -15.4267 )
scale = Vector2( 0.887838, 1.31668 )
shape = SubResource( 1 )
disabled = true
[node name="InGameUI" parent="." index="1" instance=ExtResource( 3 )]
scale = Vector2( 1, 1 )
transform = Transform2D( 1, 0, 0, 1, 0, 0 )
[node name="Blocks" type="Node2D" parent="." index="2"]
editor/display_folded = true
[node name="Cinderblock" type="Sprite" parent="Blocks" index="0"]
position = Vector2( 134.992, 588.018 )
scale = Vector2( 0.13, 0.13 )
texture = ExtResource( 4 )
_sections_unfolded = [ "Transform" ]
[node name="Cinderblock2" type="Sprite" parent="Blocks" index="1"]
position = Vector2( 483.187, 588.018 )
scale = Vector2( 0.13, 0.13 )
texture = ExtResource( 4 )
_sections_unfolded = [ "Transform" ]
[node name="Emitter" parent="." index="3" instance=ExtResource( 5 )]
@ -81,6 +96,4 @@ scale = Vector2( 8.59375, 2.6875 )
_sections_unfolded = [ "Transform" ]
ParticleTexture = ExtResource( 6 )
[connection signal="input_event" from="Area2D" to="." method="_on_Area2D_input_event"]

@ -16,7 +16,7 @@ compress/lossy_quality=0.7
compress/hdr_mode=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

@ -16,7 +16,7 @@ compress/lossy_quality=0.7
compress/hdr_mode=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

@ -17,6 +17,7 @@ config/icon="res://icon.png"
[autoload]
GlobalVars="*res://scripts/singletons/GlobalVars.gd"
Singleton="*res://scripts/singletons/Singleton.gd"
[display]

@ -1,12 +1,11 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://scripts/BreakableObj.gd" type="Script" id=1]
[ext_resource path="res://Sprites/Plank.png" type="Texture" id=2]
[sub_resource type="RectangleShape2D" id=1]
custom_solver_bias = 0.0
extents = Vector2( 1840, 280 )
extents = Vector2( 30, 10 )
[node name="BreakableObj" type="Node2D" index="0"]
@ -14,18 +13,17 @@ script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="." index="0"]
scale = Vector2( 1, 1 )
texture = ExtResource( 2 )
scale = Vector2( 0.079791, 0.139634 )
region_rect = Rect2( 1602, 237, 1711, 379 )
_sections_unfolded = [ "Transform" ]
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="." index="1"]
scale = Vector2( 1, 1 )
scale = Vector2( 4, 1 )
rect = Rect2( -10, -10, 20, 20 )
[node name="ClickerArea" type="Area2D" parent="." index="2"]
editor/display_folded = true
input_pickable = true
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
@ -36,7 +34,6 @@ audio_bus_name = "Master"
[node name="CollisionShape2D" type="CollisionShape2D" parent="ClickerArea" index="0"]
position = Vector2( -10, -30 )
shape = SubResource( 1 )
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_screen_exited"]

@ -12,7 +12,6 @@ func _init_obj(txtrs, hp, pos, next):
position = pos
strength = hp
above = next

@ -4,6 +4,7 @@ onready var TapLabel = $InGameUI/Base/Score
onready var TimeLabel = $InGameUI/Base/Timer
onready var PlusParticles = $Emitter
export var board_cnt = 1
export var time_limit = 5.0
var current_time = 0
var can_tap = true
@ -25,6 +26,12 @@ func _process(delta):
can_tap = false
emit_signal("round_over")
func tapped():
if can_tap:
taps += 1
PlusParticles.emit()
update_labels()
func _on_Area2D_input_event(viewport, event, shape_idx):
if can_tap and event is InputEventMouseButton and \
event.is_pressed() and not get_tree().paused:
@ -34,4 +41,4 @@ func _on_Area2D_input_event(viewport, event, shape_idx):
func update_labels():
if can_tap:
TapLabel.set_text(str(taps + GlobalVars.Points))
TapLabel.set_text(str(taps + GlobalVars.Points))

@ -25,4 +25,5 @@ func emit():
func _on_tween_completed(object, key):
if is_a_parent_of(object):
remove_child(object)
remove_child(object)
object.queue_free()
Loading…
Cancel
Save