2022-05-29
This commit is contained in:
parent
df249a1289
commit
1e8217dd13
|
@ -28,6 +28,7 @@ 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
|
||||
|
|
|
@ -28,6 +28,7 @@ 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
|
||||
|
|
|
@ -28,6 +28,7 @@ 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
|
||||
|
|
|
@ -28,6 +28,7 @@ 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
|
||||
|
|
|
@ -12,7 +12,7 @@ _global_script_classes=[ {
|
|||
"base": "",
|
||||
"class": "GitAPI",
|
||||
"language": "NativeScript",
|
||||
"path": "res://git_api.gdns"
|
||||
"path": "res://addons/godot-git-plugin/git_api.gdns"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"GitAPI": ""
|
||||
|
@ -26,10 +26,10 @@ config/icon="res://images/bomb.png"
|
|||
|
||||
[autoload]
|
||||
|
||||
NavigationSystem="res://singletons/NavigationSystem.gd"
|
||||
PlayerAttributes="res://singletons/PlayerAttributes.gd"
|
||||
BombTimer="res://singletons/BombTimer.gd"
|
||||
BonusGenerator="res://singletons/BonusGenerator.gd"
|
||||
NavigationSystem="*res://scenes/autoload/NavigationSystem.gd"
|
||||
PlayerAttributes="*res://scenes/autoload/PlayerAttributes.gd"
|
||||
BombTimer="*res://scenes/autoload/BombTimer.gd"
|
||||
BonusGenerator="*res://scenes/autoload/BonusGenerator.gd"
|
||||
|
||||
[display]
|
||||
|
||||
|
@ -40,6 +40,11 @@ window/size/test_height=540
|
|||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[editor]
|
||||
|
||||
version_control/autoload_on_startup=true
|
||||
version_control/plugin_name="GitAPI"
|
||||
|
||||
[gdnative]
|
||||
|
||||
singletons=[ "res://git_api.gdnlib" ]
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://fonts/liberation/LiberationMono-Regular.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
size = 10
|
||||
font_data = ExtResource( 1 )
|
|
@ -1,47 +0,0 @@
|
|||
extends RigidBody2D
|
||||
|
||||
export (PackedScene) var Explode
|
||||
|
||||
onready var btimer = get_node("/root/BombTimer")
|
||||
onready var navigation = get_node("/root/NavigationSystem")
|
||||
onready var pattributes = get_node("/root/PlayerAttributes")
|
||||
|
||||
var bomb_id
|
||||
|
||||
func _ready():
|
||||
$CollisionShape2D.set_deferred("disabled", true)
|
||||
$TimerForDetonation.set_wait_time(btimer.get_bomb_wait_time())
|
||||
$TimerForDetonation.start()
|
||||
set_bomb_id()
|
||||
|
||||
|
||||
func _on_TimerForDetonation_timeout():
|
||||
var b_pos = self.position # or $".".position
|
||||
var grid_b_pos = navigation.find_position(b_pos)
|
||||
call_explode(grid_b_pos)
|
||||
navigation.reset_bomb_coordinates(bomb_id)
|
||||
$TimerForCleaning.start()
|
||||
pattributes.set_available_bombs(1)
|
||||
|
||||
|
||||
func _on_TimerForCleaning_timeout():
|
||||
# hide()
|
||||
queue_free()
|
||||
|
||||
|
||||
func set_bomb_id():
|
||||
bomb_id = navigation.get_bomb_id()
|
||||
|
||||
|
||||
func call_explode(explode_pos: Vector2):
|
||||
var explode = Explode.instance()
|
||||
position = explode_pos * navigation.tile_size()
|
||||
$CollisionShape2D.set_deferred("disabled", true)
|
||||
self.sleeping = true
|
||||
$AudioStreamPlayer.play()
|
||||
add_child(explode)
|
||||
|
||||
|
||||
func _on_BombArea_area_exited(area):
|
||||
if area.name == "PlayerArea":
|
||||
$CollisionShape2D.set_deferred("disabled", false)
|
|
@ -1,51 +0,0 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/Bomb.gd" type="Script" id=1]
|
||||
[ext_resource path="res://sounds/553430__blazikku__kb-poppop-0.wav" type="AudioStream" id=2]
|
||||
[ext_resource path="res://images/bomb.png" type="Texture" id=3]
|
||||
[ext_resource path="res://scenes/BombExplode.tscn" type="PackedScene" id=4]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[node name="Bomb" type="RigidBody2D" groups=[
|
||||
"bombs",
|
||||
]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2147483671
|
||||
mode = 2
|
||||
gravity_scale = 0.0
|
||||
script = ExtResource( 1 )
|
||||
Explode = ExtResource( 4 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
|
||||
[node name="TimerForDetonation" type="Timer" parent="."]
|
||||
wait_time = 3.0
|
||||
one_shot = true
|
||||
|
||||
[node name="TimerForCleaning" type="Timer" parent="."]
|
||||
wait_time = 0.5
|
||||
one_shot = true
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="BombArea" type="Area2D" parent="."]
|
||||
collision_layer = 128
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="BombArea"]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="timeout" from="TimerForDetonation" to="." method="_on_TimerForDetonation_timeout"]
|
||||
[connection signal="timeout" from="TimerForCleaning" to="." method="_on_TimerForCleaning_timeout"]
|
||||
[connection signal="area_exited" from="BombArea" to="." method="_on_BombArea_area_exited"]
|
||||
[connection signal="body_entered" from="BombArea" to="." method="_on_BombArea_body_entered"]
|
|
@ -1,48 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://images/explode_one_end.png" type="Texture" id=1]
|
||||
[ext_resource path="res://images/explode_all.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 7, 23 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 23, 7 )
|
||||
|
||||
[node name="Explode" type="Node2D"]
|
||||
|
||||
[node name="ExplodeArea2D" type="Area2D" parent="."]
|
||||
collision_layer = 8
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="ExplodeArea2D"]
|
||||
texture = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="explode_one_end_up" type="Sprite" parent="ExplodeArea2D"]
|
||||
position = Vector2( 8, -8 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="explode_one_end_down" type="Sprite" parent="ExplodeArea2D"]
|
||||
position = Vector2( 8, 24 )
|
||||
texture = ExtResource( 1 )
|
||||
flip_v = true
|
||||
|
||||
[node name="explode_one_end_left" type="Sprite" parent="ExplodeArea2D"]
|
||||
position = Vector2( -8, 8 )
|
||||
rotation = 1.57024
|
||||
texture = ExtResource( 1 )
|
||||
flip_v = true
|
||||
|
||||
[node name="explode_one_end_right" type="Sprite" parent="ExplodeArea2D"]
|
||||
position = Vector2( 24, 8 )
|
||||
rotation = 1.57131
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2DV" type="CollisionShape2D" parent="ExplodeArea2D"]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="CollisionShape2DH" type="CollisionShape2D" parent="ExplodeArea2D"]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 2 )
|
|
@ -1,28 +0,0 @@
|
|||
extends Area2D
|
||||
|
||||
onready var pattributes = get_node("/root/PlayerAttributes")
|
||||
|
||||
var bonus_type
|
||||
|
||||
func _on_Bonus_area_entered(area):
|
||||
if area.name == "PlayerArea":
|
||||
match bonus_type:
|
||||
"live":
|
||||
pattributes.set_player_number_of_lives(1)
|
||||
get_parent().queue_free()
|
||||
"speed":
|
||||
pattributes.set_player_speed(10)
|
||||
get_parent().queue_free()
|
||||
"bomb":
|
||||
pattributes.set_player_number_of_bombs(1)
|
||||
pattributes.set_available_bombs(1)
|
||||
get_parent().queue_free()
|
||||
"invisible":
|
||||
pattributes.set_player_invisible()
|
||||
get_parent().queue_free()
|
||||
"pusher":
|
||||
pattributes.set_player_pusher()
|
||||
get_parent().queue_free()
|
||||
|
||||
func set_bonus_type(type):
|
||||
bonus_type = type
|
|
@ -1,20 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/Bonus.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[node name="Bonus" type="Area2D"]
|
||||
collision_layer = 32
|
||||
collision_mask = 2
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
centered = false
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_Bonus_area_entered"]
|
|
@ -1,44 +0,0 @@
|
|||
extends StaticBody2D
|
||||
|
||||
export (PackedScene) var Bonus
|
||||
|
||||
onready var navigation = get_node("/root/NavigationSystem")
|
||||
onready var bgen = get_node("/root/BonusGenerator")
|
||||
|
||||
var generated_bonus
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.name == "ExplodeArea2D":
|
||||
break_down_a_box()
|
||||
|
||||
func break_down_a_box():
|
||||
generated_bonus = bgen.bonus_generate()
|
||||
# print(generated_bonus)
|
||||
match generated_bonus:
|
||||
"empty":
|
||||
queue_free()
|
||||
"live":
|
||||
prepare_bonus()
|
||||
$Bonus/Sprite.set_texture(load("res://images/bonus_heart.png"))
|
||||
"speed":
|
||||
prepare_bonus()
|
||||
$Bonus/Sprite.set_texture(load("res://images/bonus_speed.png"))
|
||||
"bomb":
|
||||
prepare_bonus()
|
||||
$Bonus/Sprite.set_texture(load("res://images/bonus_bomb.png"))
|
||||
"invisible":
|
||||
prepare_bonus()
|
||||
$Bonus/Sprite.set_texture(load("res://images/bonus_invisible.png"))
|
||||
"radius":
|
||||
prepare_bonus()
|
||||
$Bonus/Sprite.set_texture(load("res://images/bonus_radius.png"))
|
||||
"pusher":
|
||||
prepare_bonus()
|
||||
$Bonus/Sprite.set_texture(load("res://images/bonus_pusher.png"))
|
||||
|
||||
func prepare_bonus():
|
||||
var bonus = Bonus.instance()
|
||||
$CollisionShape2D.set_deferred("disabled", true)
|
||||
$BoxArea2D/CollisionShape2D2.set_deferred("disabled", true)
|
||||
add_child(bonus)
|
||||
$Bonus.set_bonus_type(generated_bonus)
|
|
@ -1,32 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://images/box.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scenes/Box.gd" type="Script" id=2]
|
||||
[ext_resource path="res://scenes/Bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 8, 8 )
|
||||
|
||||
[node name="Box" type="StaticBody2D"]
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource( 2 )
|
||||
Bonus = ExtResource( 3 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="BoxArea2D" type="Area2D" parent="."]
|
||||
collision_layer = 16
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="BoxArea2D"]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="area_entered" from="BoxArea2D" to="." method="_on_Area2D_area_entered"]
|
|
@ -1,9 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://sounds/170417__eelke__bang-03-clean.mp3" type="AudioStream" id=1]
|
||||
|
||||
[node name="BoxExplode" type="Node2D"]
|
||||
|
||||
[node name="BreakDown" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 1 )
|
||||
autoplay = true
|
|
@ -1,66 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scenes/Settings.gd" type="Script" id=2]
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
color = Color( 0.337255, 0.298039, 0.298039, 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 60
|
||||
custom_constants/margin_top = 12
|
||||
custom_constants/margin_left = 60
|
||||
custom_constants/margin_bottom = 12
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CenterContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 60.0
|
||||
margin_top = 12.0
|
||||
margin_right = 260.0
|
||||
margin_bottom = 168.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 12.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Credits"
|
||||
align = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 156.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TextEdit" type="RichTextLabel" parent="MarginContainer/CenterContainer/MarginContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 140.0
|
||||
focus_mode = 2
|
||||
custom_fonts/normal_font = ExtResource( 3 )
|
||||
text = "Creator, code, art: Comminux
|
||||
Updated graphics: al3427
|
||||
|
||||
Addons used: Godot Touch Joy Pad by shinneider (Shinneider Libanio da Silva) and odbol (Tyler Freeman) - https://github.com/shinneider/godot_touchJoyPad"
|
||||
selection_enabled = true
|
||||
|
||||
[node name="BackButton" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
[connection signal="pressed" from="BackButton" to="." method="_on_BackButton_pressed"]
|
|
@ -1,8 +0,0 @@
|
|||
extends Control
|
||||
|
||||
|
||||
func _on_BackButton_pressed():
|
||||
get_tree().change_scene("res://scenes/Main.tscn")
|
||||
|
||||
func _ready():
|
||||
$MarginContainer/CenterContainer/MarginContainer/VBoxContainer/Label.text = str("Model name: ", OS.get_model_name(), " Name: ", OS.get_name())
|
|
@ -1,83 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://scenes/Settings.gd" type="Script" id=2]
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
color = Color( 0.337255, 0.298039, 0.298039, 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 60
|
||||
custom_constants/margin_top = 12
|
||||
custom_constants/margin_left = 60
|
||||
custom_constants/margin_bottom = 12
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CenterContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 60.0
|
||||
margin_top = 12.0
|
||||
margin_right = 260.0
|
||||
margin_bottom = 168.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 12.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Options"
|
||||
align = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 156.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/MarginContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 140.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 24.0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 38.0
|
||||
margin_top = 6.0
|
||||
margin_right = 134.0
|
||||
margin_bottom = 18.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Show debug info:"
|
||||
|
||||
[node name="CheckBox" type="CheckBox" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 138.0
|
||||
margin_right = 162.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 28.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 40.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
|
||||
[node name="BackButton" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[connection signal="pressed" from="BackButton" to="." method="_on_BackButton_pressed"]
|
|
@ -1,17 +1,17 @@
|
|||
[gd_scene load_steps=17 format=2]
|
||||
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://fonts/LiberationMono-Regular.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://images/bomb.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scenes/Bomb.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scenes/entities/Bomb.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://plugins/touchJoyPad/touchJoyPad.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://images/walls_tilemap.png" type="Texture" id=5]
|
||||
[ext_resource path="res://images/box.png" type="Texture" id=6]
|
||||
[ext_resource path="res://scenes/Game.gd" type="Script" id=7]
|
||||
[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://scenes/Box.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://scenes/player/Player.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://scenes/ui/templates/BackButton.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://scenes/entities/Box.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://sounds/507906__m-cel__warning-sound.ogg" type="AudioStream" id=11]
|
||||
[ext_resource path="res://scenes/BombExplode.tscn" type="PackedScene" id=12]
|
||||
[ext_resource path="res://scenes/entities/BombExplode.tscn" type="PackedScene" id=12]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
points = PoolVector2Array( 0, 2, 0, 0, 16, 0, 16, 2, 16, 14, 16, 16, 0, 16, 0, 14 )
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
extends Control
|
||||
|
||||
|
||||
onready var navigation = get_node("/root/NavigationSystem")
|
||||
|
||||
var count = 0
|
||||
var count = 0 # Cчётчик
|
||||
|
||||
|
||||
func _on_NewGame_pressed():
|
||||
|
@ -36,9 +33,9 @@ func _on_Link_pressed():
|
|||
|
||||
func _on_Singleplayer_pressed():
|
||||
get_tree().change_scene("res://scenes/Game.tscn")
|
||||
navigation.network_mode = false
|
||||
NavigationSystem.network_mode = false
|
||||
|
||||
|
||||
func _on_Multiplayer_pressed():
|
||||
get_tree().change_scene("res://scenes/Multiplayer.tscn")
|
||||
navigation.network_mode = true
|
||||
NavigationSystem.network_mode = true
|
||||
|
|
330
scenes/Main.tscn
330
scenes/Main.tscn
|
@ -1,9 +1,11 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://images/bomb.png" type="Texture" id=2]
|
||||
[ext_resource path="res://images/fluffy.png" type="Texture" id=3]
|
||||
[ext_resource path="res://scenes/Main.gd" type="Script" id=4]
|
||||
[ext_resource path="res://scenes/Main.gd" type="Script" id=1]
|
||||
[ext_resource path="res://fonts/LiberationSans-Regular-14.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://fonts/LiberationSans-Regular-12.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://fonts/LiberationSans-Regular.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://images/fluffy.png" type="Texture" id=5]
|
||||
[ext_resource path="res://images/bomb.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="InputEventAction" id=1]
|
||||
action = "ui_select"
|
||||
|
@ -14,215 +16,195 @@ shortcut = SubResource( 1 )
|
|||
[node name="MainMenu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="BackgroundColor" type="ColorRect" parent="."]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color( 0.337255, 0.298039, 0.298039, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 25
|
||||
custom_constants/margin_top = 6
|
||||
custom_constants/margin_left = 25
|
||||
custom_constants/margin_bottom = 6
|
||||
custom_constants/margin_right = 5
|
||||
custom_constants/margin_top = 5
|
||||
custom_constants/margin_left = 5
|
||||
custom_constants/margin_bottom = 5
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 5.0
|
||||
margin_top = 5.0
|
||||
margin_right = 315.0
|
||||
margin_bottom = 175.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_right = 153.0
|
||||
margin_bottom = 170.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Logo" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_right = 153.0
|
||||
margin_bottom = 19.0
|
||||
size_flags_horizontal = 9
|
||||
alignment = 1
|
||||
|
||||
[node name="IconLogo" type="TextureRect" parent="MarginContainer/HBoxContainer/VBoxContainer/Logo"]
|
||||
margin_left = 34.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 19.0
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="TextLogo" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer/Logo"]
|
||||
margin_left = 54.0
|
||||
margin_right = 118.0
|
||||
margin_bottom = 19.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Bombers"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_left = 44.0
|
||||
margin_top = 55.0
|
||||
margin_right = 108.0
|
||||
margin_bottom = 119.0
|
||||
rect_min_size = Vector2( 64, 64 )
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 5 )
|
||||
expand = true
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Copyright" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_top = 156.0
|
||||
margin_right = 153.0
|
||||
margin_bottom = 170.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "© 2021-2022 tmon8.ru"
|
||||
align = 1
|
||||
|
||||
[node name="Link" type="TextureButton" parent="MarginContainer/HBoxContainer/VBoxContainer/Copyright"]
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -16.0
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="MenuControl" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_left = 157.0
|
||||
margin_right = 310.0
|
||||
margin_bottom = 170.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/separation = 12
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/MenuControl"]
|
||||
margin_right = 153.0
|
||||
margin_bottom = 144.0
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 30
|
||||
custom_constants/margin_top = 0
|
||||
custom_constants/margin_left = 30
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MenuControl/MarginContainer"]
|
||||
margin_left = 30.0
|
||||
margin_right = 123.0
|
||||
margin_bottom = 144.0
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 8
|
||||
alignment = 1
|
||||
|
||||
[node name="NewGame" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 93.0
|
||||
margin_bottom = 38.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
shortcut = SubResource( 2 )
|
||||
text = "New Game"
|
||||
|
||||
[node name="Settings" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer"]
|
||||
margin_top = 46.0
|
||||
margin_right = 93.0
|
||||
margin_bottom = 68.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Settings"
|
||||
|
||||
[node name="Credits" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer"]
|
||||
margin_top = 76.0
|
||||
margin_right = 93.0
|
||||
margin_bottom = 98.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Credits"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 25.0
|
||||
margin_top = 6.0
|
||||
margin_right = 295.0
|
||||
margin_bottom = 175.0
|
||||
[node name="Exit" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer"]
|
||||
margin_top = 106.0
|
||||
margin_right = 93.0
|
||||
margin_bottom = 128.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Exit"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_right = 133.0
|
||||
margin_bottom = 169.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_left = 34.0
|
||||
margin_top = 44.0
|
||||
margin_right = 98.0
|
||||
margin_bottom = 108.0
|
||||
rect_min_size = Vector2( 64, 64 )
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 3 )
|
||||
expand = true
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
margin_top = 157.0
|
||||
margin_right = 133.0
|
||||
margin_bottom = 169.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/MenuControl"]
|
||||
margin_top = 156.0
|
||||
margin_right = 153.0
|
||||
margin_bottom = 170.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Build 0.2.0"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="BuildVersion" type="TextureButton" parent="MarginContainer/HBoxContainer/VBoxContainer/Label"]
|
||||
[node name="BuildVersion" type="TextureButton" parent="MarginContainer/HBoxContainer/MenuControl/Label"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MenuControl" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
|
||||
margin_left = 137.0
|
||||
margin_right = 270.0
|
||||
margin_bottom = 169.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/separation = 12
|
||||
|
||||
[node name="Logo" type="HBoxContainer" parent="MarginContainer/HBoxContainer/MenuControl"]
|
||||
margin_left = 71.0
|
||||
margin_right = 133.0
|
||||
margin_bottom = 16.0
|
||||
size_flags_horizontal = 8
|
||||
alignment = 2
|
||||
|
||||
[node name="IconLogo" type="TextureRect" parent="MarginContainer/HBoxContainer/MenuControl/Logo"]
|
||||
margin_right = 16.0
|
||||
margin_bottom = 16.0
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="TextLogo" type="Label" parent="MarginContainer/HBoxContainer/MenuControl/Logo"]
|
||||
margin_left = 20.0
|
||||
margin_top = 2.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 14.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Bombers"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer/MenuControl"]
|
||||
margin_left = 73.0
|
||||
margin_top = 28.0
|
||||
margin_right = 133.0
|
||||
margin_bottom = 130.0
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 10
|
||||
alignment = 1
|
||||
|
||||
[node name="NewGame" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/VBoxContainer"]
|
||||
margin_right = 60.0
|
||||
margin_bottom = 18.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
shortcut = SubResource( 2 )
|
||||
text = "New Game"
|
||||
|
||||
[node name="Settings" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/VBoxContainer"]
|
||||
margin_top = 28.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 46.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Settings"
|
||||
|
||||
[node name="Credits" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/VBoxContainer"]
|
||||
margin_top = 56.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 74.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Credits"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Exit" type="Button" parent="MarginContainer/HBoxContainer/MenuControl/VBoxContainer"]
|
||||
margin_top = 84.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 102.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Exit"
|
||||
|
||||
[node name="Copyright" type="Label" parent="MarginContainer/HBoxContainer/MenuControl"]
|
||||
margin_left = 37.0
|
||||
margin_top = 142.0
|
||||
margin_right = 133.0
|
||||
margin_bottom = 169.0
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 1
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "© 2021-2022
|
||||
https://tmon8.ru"
|
||||
align = 2
|
||||
|
||||
[node name="Link" type="TextureButton" parent="MarginContainer/HBoxContainer/MenuControl/Copyright"]
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -16.0
|
||||
__meta__ = {
|
||||
"_edit_group_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="PopupDialog" type="PopupDialog" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -60.0
|
||||
margin_top = -40.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 40.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
anchor_left = 0.3
|
||||
anchor_top = 0.3
|
||||
anchor_right = 0.7
|
||||
anchor_bottom = 0.7
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PopupDialog"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -50.0
|
||||
margin_top = -40.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 40.0
|
||||
custom_constants/separation = 15
|
||||
margin_left = 11.0
|
||||
margin_top = 3.0
|
||||
margin_right = 118.0
|
||||
margin_bottom = 68.0
|
||||
custom_constants/separation = 7
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Singleplayer" type="Button" parent="PopupDialog/VBoxContainer"]
|
||||
margin_top = 12.0
|
||||
margin_right = 100.0
|
||||
margin_bottom = 32.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
margin_top = 4.0
|
||||
margin_right = 107.0
|
||||
margin_bottom = 29.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Single-player"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Multiplayer" type="Button" parent="PopupDialog/VBoxContainer"]
|
||||
margin_top = 47.0
|
||||
margin_right = 100.0
|
||||
margin_bottom = 67.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
margin_top = 36.0
|
||||
margin_right = 107.0
|
||||
margin_bottom = 61.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Multiplayer"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer/Label/BuildVersion" to="." method="_on_BuildVersion_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/VBoxContainer/NewGame" to="." method="_on_NewGame_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/VBoxContainer/Settings" to="." method="_on_Settings_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/VBoxContainer/Credits" to="." method="_on_Credits_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/VBoxContainer/Exit" to="." method="_on_Exit_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/Copyright/Link" to="." method="_on_Link_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer/Copyright/Link" to="." method="_on_Link_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer/NewGame" to="." method="_on_NewGame_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer/Settings" to="." method="_on_Settings_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer/Credits" to="." method="_on_Credits_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/MarginContainer/VBoxContainer/Exit" to="." method="_on_Exit_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/HBoxContainer/MenuControl/Label/BuildVersion" to="." method="_on_BuildVersion_pressed"]
|
||||
[connection signal="pressed" from="PopupDialog/VBoxContainer/Singleplayer" to="." method="_on_Singleplayer_pressed"]
|
||||
[connection signal="pressed" from="PopupDialog/VBoxContainer/Multiplayer" to="." method="_on_Multiplayer_pressed"]
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
extends Control
|
||||
|
||||
onready var navigation = get_node("/root/NavigationSystem")
|
||||
|
||||
var host_ip: String = "localhost"
|
||||
|
||||
func _ready():
|
||||
get_tree().connect("network_peer_connected", self, "_connected")
|
||||
var local_ip
|
||||
|
||||
for address in IP.get_local_addresses():
|
||||
if (address.split('.').size() == 4):
|
||||
local_ip=address
|
||||
|
||||
$MarginContainer/CenterContainer/MarginContainer/VBoxContainer/MyIP.text = str("My IP: ", local_ip)
|
||||
$MarginContainer/CenterContainer/MarginContainer/VBoxContainer/LineEdit.text = str(host_ip)
|
||||
|
||||
|
||||
func _on_BackButton_pressed():
|
||||
get_tree().change_scene("res://scenes/Main.tscn")
|
||||
|
||||
|
||||
func _on_Host_pressed():
|
||||
var server = NetworkedMultiplayerENet.new()
|
||||
server.create_server(22080, 4)
|
||||
get_tree().set_network_peer(server)
|
||||
|
||||
|
||||
func _on_Join_pressed():
|
||||
var client = NetworkedMultiplayerENet.new()
|
||||
client.create_client(host_ip, 22080)
|
||||
get_tree().set_network_peer(client)
|
||||
|
||||
|
||||
func _connected(client_id):
|
||||
navigation.user_id = client_id
|
||||
print("client_id: ", navigation.user_id)
|
||||
var game_scene = preload("res://scenes/NetworkGame.tscn").instance()
|
||||
get_tree().get_root().add_child(game_scene)
|
||||
hide()
|
||||
|
||||
|
||||
func _on_LineEdit_text_entered(new_text):
|
||||
host_ip = new_text
|
||||
print(host_ip)
|
|
@ -1,95 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scenes/Multiplayer.gd" type="Script" id=2]
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color( 0.337255, 0.298039, 0.298039, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 60
|
||||
custom_constants/margin_top = 12
|
||||
custom_constants/margin_left = 60
|
||||
custom_constants/margin_bottom = 12
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CenterContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 60.0
|
||||
margin_top = 12.0
|
||||
margin_right = 260.0
|
||||
margin_bottom = 168.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 12.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Options"
|
||||
align = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 156.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/MarginContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 140.0
|
||||
custom_constants/separation = 15
|
||||
alignment = 1
|
||||
|
||||
[node name="MyIP" type="Label" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 12.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 24.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
align = 1
|
||||
|
||||
[node name="Host" type="Button" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 39.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 57.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Create a server"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 72.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 94.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
align = 1
|
||||
clear_button_enabled = true
|
||||
caret_blink = true
|
||||
|
||||
[node name="Join" type="Button" parent="MarginContainer/CenterContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 109.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 127.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Connect to the server"
|
||||
|
||||
[node name="BackButton" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/CenterContainer/MarginContainer/VBoxContainer/Host" to="." method="_on_Host_pressed"]
|
||||
[connection signal="text_entered" from="MarginContainer/CenterContainer/MarginContainer/VBoxContainer/LineEdit" to="." method="_on_LineEdit_text_entered"]
|
||||
[connection signal="pressed" from="MarginContainer/CenterContainer/MarginContainer/VBoxContainer/Join" to="." method="_on_Join_pressed"]
|
||||
[connection signal="pressed" from="BackButton" to="." method="_on_BackButton_pressed"]
|
|
@ -1,17 +1,16 @@
|
|||
[gd_scene load_steps=17 format=2]
|
||||
[gd_scene load_steps=16 format=2]
|
||||
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://images/bomb.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scenes/NetworkGame.gd" type="Script" id=3]
|
||||
[ext_resource path="res://plugins/touchJoyPad/touchJoyPad.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://images/walls_tilemap.png" type="Texture" id=5]
|
||||
[ext_resource path="res://images/box.png" type="Texture" id=6]
|
||||
[ext_resource path="res://scenes/Box.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://scenes/Bomb.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://scenes/entities/Box.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://scenes/player/Player.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://scenes/ui/templates/BackButton.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://scenes/entities/Bomb.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://sounds/507906__m-cel__warning-sound.ogg" type="AudioStream" id=11]
|
||||
[ext_resource path="res://scenes/BoxExplode.tscn" type="PackedScene" id=12]
|
||||
[ext_resource path="res://scenes/entities/BoxExplode.tscn" type="PackedScene" id=12]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
points = PoolVector2Array( 0, 2, 0, 0, 16, 0, 16, 2, 16, 14, 16, 16, 0, 16, 0, 14 )
|
||||
|
@ -132,7 +131,6 @@ margin_left = 16.0
|
|||
margin_top = 0.201151
|
||||
margin_right = 80.0
|
||||
margin_bottom = 16.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
|
@ -144,7 +142,6 @@ margin_left = 15.9594
|
|||
margin_top = 159.996
|
||||
margin_right = 127.959
|
||||
margin_bottom = 175.996
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
|
@ -156,7 +153,6 @@ margin_left = 191.959
|
|||
margin_top = 159.996
|
||||
margin_right = 303.959
|
||||
margin_bottom = 175.996
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
|
||||
onready var navigation = get_node("/root/NavigationSystem")
|
||||
onready var pattributes = get_node("/root/PlayerAttributes")
|
||||
|
||||
export (PackedScene) var Bomb
|
||||
export (int, 0, 200) var push = 100
|
||||
|
||||
remote func _set_pos(position):
|
||||
global_transform.origin = position
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
var p_pos = self.position
|
||||
var grid_p_pos = navigation.find_position(p_pos)
|
||||
var velocity = Vector2()
|
||||
|
||||
if Input.is_action_pressed("ui_right"):
|
||||
velocity.x += 1
|
||||
if Input.is_action_pressed("ui_left"):
|
||||
velocity.x -= 1
|
||||
if Input.is_action_pressed("ui_down"):
|
||||
velocity.y += 1
|
||||
if Input.is_action_pressed("ui_up"):
|
||||
velocity.y -= 1
|
||||
|
||||
if Input.is_action_pressed("speed_increase"):
|
||||
pattributes.set_player_speed(10)
|
||||
if Input.is_action_pressed("speed_reduction"):
|
||||
pattributes.set_player_speed(-10)
|
||||
|
||||
|
||||
if velocity.x != 0:
|
||||
$AnimatedSprite.animation = "side"
|
||||
$AnimatedSprite.flip_v = false
|
||||
$AnimatedSprite.flip_h = velocity.x > 0
|
||||
elif velocity.y < 0:
|
||||
$AnimatedSprite.animation = "back"
|
||||
$AnimatedSprite.flip_v = velocity.y > 0
|
||||
else:
|
||||
$AnimatedSprite.animation = "default"
|
||||
|
||||
if velocity.length() > 0:
|
||||
# I dont need in movement normalisation.
|
||||
# velocity = velocity.normalized() * SPEED
|
||||
velocity = velocity * pattributes.get_player_speed()
|
||||
|
||||
# move_and_slide() ignores the rigid body’s physics properties due to the kinematic move function’s infinite_inertia parameter.
|
||||
# http://kidscancode.org/godot_recipes/physics/kinematic_to_rigidbody/
|
||||
if navigation.network_mode != true:
|
||||
move_and_slide(velocity, Vector2.ZERO, false, 4, PI/4, false)
|
||||
else:
|
||||
if is_network_master():
|
||||
move_and_slide(velocity, Vector2.ZERO, false, 4, PI/4, false)
|
||||
rpc_unreliable("_set_pos", global_transform.origin)
|
||||
|
||||
|
||||
if pattributes.get_player_pusher() == true:
|
||||
for index in self.get_slide_count():
|
||||
var collision = self.get_slide_collision(index)
|
||||
if collision.collider.is_in_group("bombs"):
|
||||
collision.collider.apply_central_impulse(-collision.normal * push)
|
||||
|
||||
# print(pattributes.get_player_invisible())
|
||||
if pattributes.get_player_invisible() == true:
|
||||
self.set_deferred("modulate", Color( 1, 1, 1, 0.45 ))
|
||||
if pattributes.get_player_invisible() == false:
|
||||
self.set_deferred("modulate", Color( 1, 1, 1, 1 ))
|
||||
|
||||
|
||||
func create_a_bomb(bomb_pos: Vector2):
|
||||
if pattributes.get_available_bombs() > 0:
|
||||
if navigation.save_bomb_coordinates(bomb_pos) == true:
|
||||
pattributes.set_available_bombs(-1)
|
||||
var bomb = Bomb.instance()
|
||||
bomb.position = bomb_pos * navigation.tile_size()
|
||||
add_child(bomb)
|
|
@ -1,53 +0,0 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://images/fluffy.png" type="Texture" id=2]
|
||||
[ext_resource path="res://images/fluffy_side.png" type="Texture" id=3]
|
||||
[ext_resource path="res://images/fluffy_back.png" type="Texture" id=4]
|
||||
[ext_resource path="res://scenes/Bomb.tscn" type="PackedScene" id=5]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 2 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 4 ) ],
|
||||
"loop": true,
|
||||
"name": "back",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 3 ) ],
|
||||
"loop": true,
|
||||
"name": "side",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 7, 7 )
|
||||
|
||||
[node name="Player" type="KinematicBody2D" groups=["players"]]
|
||||
collision_layer = 2
|
||||
collision_mask = 53
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
Bomb = ExtResource( 5 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 1 )
|
||||
centered = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="PlayerArea" type="Area2D" parent="."]
|
||||
collision_layer = 2
|
||||
collision_mask = 32
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="PlayerArea"]
|
||||
position = Vector2( 8, 8 )
|
||||
shape = SubResource( 2 )
|
|
@ -1,5 +0,0 @@
|
|||
extends Control
|
||||
|
||||
|
||||
func _on_BackButton_pressed():
|
||||
get_tree().change_scene("res://scenes/Main.tscn")
|
|
@ -1,59 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/Settings.gd" type="Script" id=1]
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
color = Color( 0.337255, 0.298039, 0.298039, 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 60
|
||||
custom_constants/margin_top = 12
|
||||
custom_constants/margin_left = 60
|
||||
custom_constants/margin_bottom = 12
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CenterContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 60.0
|
||||
margin_top = 12.0
|
||||
margin_right = 260.0
|
||||
margin_bottom = 168.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 12.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Options"
|
||||
align = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 156.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/MarginContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 140.0
|
||||
|
||||
[node name="BackButton" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[connection signal="pressed" from="BackButton" to="." method="_on_BackButton_pressed"]
|
|
@ -1,15 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://images/go_back_to_the_main_menu.png" type="Texture" id=1]
|
||||
|
||||
[node name="BackButton" type="TextureButton"]
|
||||
modulate = Color( 1, 1, 1, 0.498039 )
|
||||
margin_left = 264.0
|
||||
margin_top = 24.0
|
||||
margin_right = 280.0
|
||||
margin_bottom = 40.0
|
||||
rect_scale = Vector2( 2, 2 )
|
||||
texture_normal = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://resources/LiberationMono-Regular.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://scenes/templates/BackButton.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scenes/Settings.gd" type="Script" id=3]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_right = 320.0
|
||||
margin_bottom = 180.0
|
||||
color = Color( 0.337255, 0.298039, 0.298039, 1 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_constants/margin_right = 60
|
||||
custom_constants/margin_top = 12
|
||||
custom_constants/margin_left = 60
|
||||
custom_constants/margin_bottom = 12
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CenterContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 60.0
|
||||
margin_top = 12.0
|
||||
margin_right = 260.0
|
||||
margin_bottom = 168.0
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/CenterContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 12.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Options"
|
||||
align = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 156.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/MarginContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 140.0
|
||||
|
||||
[node name="BackButton" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[connection signal="pressed" from="BackButton" to="." method="_on_BackButton_pressed"]
|
|
@ -1,9 +0,0 @@
|
|||
extends Node
|
||||
|
||||
var bomb_wait_time: float = 3.0
|
||||
|
||||
func set_bomb_wait_time(changed_time):
|
||||
bomb_wait_time = changed_time
|
||||
|
||||
func get_bomb_wait_time():
|
||||
return bomb_wait_time
|
|
@ -1,10 +0,0 @@
|
|||
extends Node
|
||||
|
||||
var bonuses = ["empty", "live", "speed", "bomb", "invisible", "radius", "pusher"]
|
||||
#var bonuses = ["empty", "live", "speed", "bomb", "invisible","pusher", "thrower"]
|
||||
|
||||
func bonus_generate():
|
||||
# print("The position of the destroyed box: ", position)
|
||||
var random_bonus = randi() % bonuses.size() + 1
|
||||
# print("Выбран бонус: ", bonuses[random_bonus - 1])
|
||||
return bonuses[random_bonus - 1]
|
|
@ -1,41 +0,0 @@
|
|||
extends Node
|
||||
|
||||
const TILE_SIZE = 16
|
||||
var bomb_count = 0
|
||||
var bomb_number = Array()
|
||||
var array_of_vectors = PoolVector2Array()
|
||||
var user_id = -1
|
||||
var network_mode: bool
|
||||
|
||||
func tile_size():
|
||||
return TILE_SIZE
|
||||
|
||||
func find_position(o_pos: Vector2):
|
||||
var divided_near_pos = Vector2()
|
||||
divided_near_pos.x = stepify(o_pos.x, TILE_SIZE) / TILE_SIZE
|
||||
divided_near_pos.y = stepify(o_pos.y, TILE_SIZE) / TILE_SIZE
|
||||
return divided_near_pos
|
||||
|
||||
|
||||
func save_bomb_coordinates(bomb_pos):
|
||||
# print("bomb_pos: ", bomb_pos)
|
||||
if !array_of_vectors.empty():
|
||||
var e = array_of_vectors.size()
|
||||
for i in range(e):
|
||||
if array_of_vectors[i] == bomb_pos:
|
||||
return false
|
||||
array_of_vectors.append(bomb_pos)
|
||||
bomb_count = bomb_count + 1
|
||||
bomb_number.append(bomb_count)
|
||||
return true
|
||||
else:
|
||||
array_of_vectors.push_back(bomb_pos)
|
||||
return true
|
||||
|
||||
|
||||
func get_bomb_id():
|
||||
return bomb_count
|
||||
|
||||
|
||||
func reset_bomb_coordinates(bomb_id):
|
||||
array_of_vectors.set(bomb_id, Vector2(0,0))
|
|
@ -1,67 +0,0 @@
|
|||
extends Node
|
||||
|
||||
var player_speed: int
|
||||
var player_number_of_bombs: int
|
||||
var player_number_of_lives: int
|
||||
var available_bombs: int
|
||||
var invisible_time: float
|
||||
var player_invisible: bool
|
||||
var player_pusher: bool
|
||||
|
||||
|
||||
func _ready():
|
||||
player_speed = 80
|
||||
player_number_of_bombs = 1
|
||||
player_number_of_lives = 1
|
||||
available_bombs = 1
|
||||
invisible_time = 8.0
|
||||
|
||||
|
||||
func set_player_speed(change_speed): # Скорость игрока
|
||||
player_speed += change_speed
|
||||
|
||||
|
||||
func set_player_number_of_bombs(change_number_of_bombs): # Количество бомб, которые игрок может установить
|
||||
player_number_of_bombs += change_number_of_bombs
|
||||
|
||||
|
||||
func set_player_number_of_lives(change_number_of_lives): # Количество взрывов, которые игрок может пережить.
|
||||
player_number_of_lives += change_number_of_lives
|
||||
|
||||
|
||||
func set_available_bombs(number):
|
||||
available_bombs += number
|
||||
|
||||
|
||||
func set_player_invisible():
|
||||
player_invisible = true
|
||||
yield(get_tree().create_timer(invisible_time), "timeout")
|
||||
player_invisible = false
|
||||
|
||||
|
||||
func set_player_pusher():
|
||||
player_pusher = true
|
||||
|
||||
|
||||
func get_player_speed(): # Скорость игрока
|
||||
return player_speed
|
||||
|
||||
|
||||
func get_player_number_of_bombs(): # Количество бомб, которые игрок может установить
|
||||
return player_number_of_bombs
|
||||
|
||||
|
||||
func get_player_number_of_lives(): # Количество взрывов, которые игрок может пережить.
|
||||
return player_number_of_lives
|
||||
|
||||
|
||||
func get_available_bombs():
|
||||
return available_bombs
|
||||
|
||||
|
||||
func get_player_invisible():
|
||||
return player_invisible
|
||||
|
||||
|
||||
func get_player_pusher():
|
||||
return player_pusher
|
|
@ -17,5 +17,7 @@ force/max_rate=false
|
|||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
||||
|
|
Loading…
Reference in New Issue