diff --git a/.gitignore b/.gitignore index 97993bd..9975de9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ data_*/ android/ *.apk *.apk.idsig +*.pck *.exe html/ diff --git a/Game.gd b/Game.gd index 5fb66d5..bafbbdd 100644 --- a/Game.gd +++ b/Game.gd @@ -10,6 +10,8 @@ func _ready(): c.queue_free() node.show() $GameOver.hide() + if not OS.has_touchscreen_ui_hint(): + $Controls.queue_free() func _process(delta): if Input.is_action_just_pressed("reset"): @@ -29,6 +31,8 @@ func _on_Timer_timeout(): $GameOver.show() func _on_Field_tank_removed(tank): + if $Controls == null: + return if(tank == 1): $Controls/Controls1.queue_free() if(tank == 2): diff --git a/Game.tscn b/Game.tscn index 7145da1..e866758 100644 --- a/Game.tscn +++ b/Game.tscn @@ -19,11 +19,11 @@ script = ExtResource( 3 ) z_index = -3 [node name="ColorRect" type="ColorRect" parent="Node2D"] -margin_left = -5.6123 -margin_top = -5.61231 -margin_right = 34.3877 -margin_bottom = 34.3877 -rect_scale = Vector2( 25.9835, 15.3862 ) +margin_left = -60.3407 +margin_top = -60.3407 +margin_right = -20.3407 +margin_bottom = -20.3407 +rect_scale = Vector2( 28.963, 18.1261 ) color = Color( 0.619608, 0.576471, 0.576471, 1 ) __meta__ = { "_edit_use_anchors_": false diff --git a/README.md b/README.md index 1e530cd..edb14c5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # zimboom A single-device muliplayer tank game + +## Play + +- [Web Browser](https://lbovet.github.io/zimboom/index.html) +- [Windows](https://github.com/lbovet/zimboom/releases/) +- [Android](ihttps://github.com/lbovet/zimboom/releases/) (coming soon on Google Play) +- OS X, iOS: please help me, I have no such devices diff --git a/Tank.gd b/Tank.gd index 8a92333..16535a9 100644 --- a/Tank.gd +++ b/Tank.gd @@ -182,3 +182,7 @@ func _on_InitTimer_timeout(): func _on_TankButton_pressed(): if virgin: die() + +func _on_MouseButton_pressed(): + if virgin: + die() diff --git a/Tank.tscn b/Tank.tscn index 1141ddf..d0ee6bf 100644 --- a/Tank.tscn +++ b/Tank.tscn @@ -147,8 +147,19 @@ position = Vector2( -32.7036, -38.7104 ) scale = Vector2( 3.27957, 3.6002 ) shape = SubResource( 3 ) -[connection signal="timeout" from="Muzzle/MuzzleFire/Timer" to="." method="_on_Timer_timeout"] +[node name="MouseButton" type="Button" parent="."] +modulate = Color( 1, 1, 1, 0 ) +margin_left = -21.3315 +margin_top = -25.832 +margin_right = 23.6685 +margin_bottom = 21.168 +rect_scale = Vector2( 0.939053, 1.05825 ) +__meta__ = { +"_edit_use_anchors_": false +} + [connection signal="timeout" from="Muzzle/MuzzleFire/Timer" to="Muzzle/MuzzleFire/Timer" method="_on_Timer_timeout"] +[connection signal="timeout" from="Muzzle/MuzzleFire/Timer" to="." method="_on_Timer_timeout"] [connection signal="timeout" from="LoadTimer" to="." method="_on_LoadTimer_timeout"] [connection signal="timeout" from="Life/Fade" to="." method="_on_Fade_timeout"] [connection signal="timeout" from="Label/Hide" to="." method="_on_Hide_timeout"] @@ -156,3 +167,4 @@ shape = SubResource( 3 ) [connection signal="timeout" from="Camera2D/FocusTimer" to="." method="_on_FocusTimer_timeout"] [connection signal="timeout" from="InitTimer" to="." method="_on_InitTimer_timeout"] [connection signal="pressed" from="Button" to="." method="_on_TankButton_pressed"] +[connection signal="pressed" from="MouseButton" to="." method="_on_MouseButton_pressed"] diff --git a/project.godot b/project.godot index cb6c76d..e5606d7 100644 --- a/project.godot +++ b/project.godot @@ -80,7 +80,7 @@ reset={ [input_devices] -pointing/emulate_touch_from_mouse=true +pointing/emulate_mouse_from_touch=false [physics]