74 lines
3.4 KiB
GDScript3
74 lines
3.4 KiB
GDScript3
|
extends Node
|
||
|
var hook
|
||
|
var spear
|
||
|
var net
|
||
|
var bait
|
||
|
var dynamite
|
||
|
var gold
|
||
|
var time = 0
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
hook = preload("res://Scenes/Hook.tscn")
|
||
|
spear = preload("res://Scenes/Spear.tscn")
|
||
|
net = preload("res://Scenes/Net.tscn")
|
||
|
bait = preload("res://Scenes/Bait.tscn")
|
||
|
dynamite = preload("res://Scenes/Dynamite.tscn")
|
||
|
gold = preload("res://Scenes/GoldenBait.tscn")
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _physics_process(delta):
|
||
|
match time:
|
||
|
1*60: create(hook, 0, 5, 0)
|
||
|
3*60: create(hook, 0, 10, 1)
|
||
|
4*60: create(hook, 0, 20, 1)
|
||
|
4*60+30: create(hook, 400, 40, 0); create(hook, -400, 40, 0)
|
||
|
6*60: create(hook, 0, 20, 0); create(hook, 600, 60, 0); create(hook, -600, 60, 0)
|
||
|
7*60: create(hook,-900, 10, 0); create(hook,-700, 10, 0); create(hook,-400, 10, 0); create(hook,-100, 10, 0); create(hook,100, 10, 0); create(hook,400, 10, 0); create(hook,700, 10, 0); create(hook,900, 10, 0)
|
||
|
9*60: create(hook,-800, 20, 0); create(hook,-600, 20, 0); create(hook,-300, 20, 0); create(hook,0, 20, 0); create(hook,300, 20, 0); create(hook,600, 20, 0); create(hook,800, 20, 0)
|
||
|
15*60: create(spear,0, 50, 0)
|
||
|
17*60: create(spear, 0, 50 ,0)
|
||
|
18*60: create(spear,0, 50, 1)
|
||
|
19*60: create(spear,0, 50, 1)
|
||
|
19*60+30: create(spear,0, 50, 1)
|
||
|
19*60+30+15:create(spear,0, 50, 1)
|
||
|
20*60: create(spear,0, 50, 1)
|
||
|
20*60+15: create(spear,0, 50, 1)
|
||
|
20*60+30: create(spear,0, 50, 1)
|
||
|
21*60: create(hook,900, 60, 0); create(hook,700, 60, 0); create(hook,-900, 60, 0); create(hook,-700, 60, 0);
|
||
|
22*60: create(hook,0, 30, 1)
|
||
|
23*60: create(spear,0, 30, 1)
|
||
|
24*60: create(hook,0, 30, 1); create(hook, 400, 40, 0); create(hook, -400, 40, 0)
|
||
|
25*60: create(spear,-600, 40, 0); create(spear, 600, 40, 0); create(spear, 0, 30, 1)
|
||
|
27*60: create(spear,-800, 30, 0); create(hook,-600, 20, 0); create(spear,-300, 30, 0); create(hook,0, 20, 0); create(spear,300, 30, 0); create(hook,600, 20, 0); create(spear,800, 30, 0)
|
||
|
28*60+30+15: create(hook,-800, 20, 0); create(spear,-600, 30, 0); create(hook,-300, 20, 0); create(spear,0, 30, 0); create(hook,300, 20, 0); create(spear,600, 30, 0); create(hook,800, 20, 0)
|
||
|
32*60+30: create(bait,0, 5, 0)
|
||
|
35*60: create(net,-192, 60, 0)
|
||
|
36*60: create(net, 317, 60,0)
|
||
|
36*60+15: create(spear,0, 30, 0)
|
||
|
36*60+30: create(spear,200, 60, 0); create(spear,-200, 60, 0)
|
||
|
36*60+30+15: create(spear,300, 60, 0); create(spear,-300, 60, 0)
|
||
|
37*60: create(spear,400, 60, 0); create(spear,-400, 60, 0)
|
||
|
37*60+15: create(spear,500, 60, 0); create(spear,-500, 60, 0)
|
||
|
37*60+30: create(spear,600, 60, 0); create(spear,-600, 60, 0)
|
||
|
37*60+30+15: create(spear, 700, 60, 0); create(spear, -700, 60, 0)
|
||
|
38*60: create(spear, 800, 60, 0); create(spear, -800, 60, 0); create(dynamite, 0, 10, 0)
|
||
|
42*60:create(net,-192, 60, 0); create(spear, 900, 60, 0); create(spear, -900, 60, 0); create(bait,0, 10, 0)
|
||
|
44*60:create(net,317, 60, 0); create(hook, 0, 30, 0); create(hook, -100, 40, 0); create(hook, 100, 40, 0);
|
||
|
46*60: create(dynamite, -900, 30, 0); create(dynamite, 900, 30, 0)
|
||
|
48*60: create(dynamite,0, 30, 0); create(hook,800, 20, 0); create(hook,-800, 20, 0)
|
||
|
51*60: create(gold,0,5,0)
|
||
|
|
||
|
|
||
|
if Input.is_action_just_pressed("Debug"):
|
||
|
print("Guess what " + str(time) + " it is!")
|
||
|
|
||
|
time += 1
|
||
|
|
||
|
func create(scene, target, speed, ai):
|
||
|
var instance = scene.instantiate()
|
||
|
instance.target = target
|
||
|
instance.speed = speed
|
||
|
instance.ai = ai
|
||
|
add_child(instance)
|