Skip to content

Commit

Permalink
Added a campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
rjblodget committed Jul 13, 2021
1 parent aab634c commit a804090
Show file tree
Hide file tree
Showing 30 changed files with 1,941 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="ae5612d486973f00748b670897caf260"
dest_md5="1f176739a4f58334cd9349aadd07583f"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="dce9117dc309baf2c74935c216394b6b"
dest_md5="93b88e738c16b34c2e936401d3e64d4e"

Binary file not shown.
45 changes: 45 additions & 0 deletions Campaign.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
extends Node2D


# Declare member variables here. Examples:
# var a = 2
# var b = "text"


# Called when the node enters the scene tree for the first time.
func _ready():
yield($Tank1,"ready")
yield($Tank2,"ready")
$Tank1.position = $SpawnPos1.position
$Tank2.position = $SpawnPos2.position


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#if $Controls.visible == true:
#$TextTimeout.start()
# pass


func _on_TextTimeout_timeout():
$Tank1/Player.visible = false
$Tank2/Enemy.visible = false
$Controls.visible = false


func _on_Area2D_body_entered(body):
if body == $Tank2:
$aWinnerIsU.visible = true
$WinScreen.start()


func _on_WinScreen_timeout():
var myroot = get_tree().get_root()
var tscreen = myroot.get_node("Campaign")
myroot.remove_child(tscreen)
tscreen.call_deferred("free")

# Add the world scene
var world_scene = load("res://TitleScreen.tscn")
var world = world_scene.instance()
myroot.add_child(world)
Loading

0 comments on commit a804090

Please sign in to comment.