Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
programaths committed Aug 15, 2022
0 parents commit 95a4f2c
Show file tree
Hide file tree
Showing 88 changed files with 1,206 additions and 0 deletions.
1 change: 1 addition & 0 deletions .import/.gdignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="f7381501f1063e19b7b6dab2be4e1f34"
dest_md5="0d63dfca37872f811e3f98729afdd09d"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/black.png-19a8df0b1a4edb74ea2eecb66d46d03d.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="662d76ec5a3a3585bc2ee9b81e6932a9"
dest_md5="e1e728c975c28dd9087bb357ad70884a"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/enemyBlue2.png-451f27f1df289543e441cc58f77ddbe0.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="bb9d10c03f0b24237a874a11e776222e"
dest_md5="e3922769c0ba1da8d18bf9509cf15ef9"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/enemyBlue4.png-e616f96957d6cc837288db5546d61cc6.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="40008b1428768b0d0dff2713e595d971"
dest_md5="50bd6ce5ca475bfe936f50f7b210f2c4"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/explosion.wav-a595096ecd3e80c5997ac70fba7fa257.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="560148f8ef4b6a92fd93fdf94904e293"
dest_md5="24eadd5cc5911f23b00a69128037f479"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
dest_md5="26ea799ea0a3da9e753b3ebe822e0570"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/laserBlue02.png-df676af43623ab1e85a8edefbaabc258.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="154bfb348c43d2feec40555db3dec939"
dest_md5="edcd1b37874d5c2abf6cdc5fae3720a7"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/laserRed02.png-40bbb9d884958aa1ac6a5e1b04a9ddec.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="9d317b9a566bb9e81e5b8441e44b014f"
dest_md5="51ca71f12a06e8af23318052bc9e5916"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/pickup.wav-8edd847517ffde8d8ef13abe76eb0d70.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="b5f30eed78cfb45149e27bb609408886"
dest_md5="a6853b7b175a3baa253adc3a085847fc"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="373b17428aff96ec36681e3379d4d9f7"
dest_md5="129bd3589f42753c83f4dd8ebe434a48"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="2c213e17323a6657546b2489479bc8f3"
dest_md5="4a9e5dbfd3c73685e53db75cc725525e"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/shoot_laser.wav-94299c8c80bcdba5824c652abc36f253.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="d02d832361cc554697c477998ecb753e"
dest_md5="940ebd13eeabf6482d4a176875b0c9c3"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/ufoBlue.png-37570a1928c2bf25b391459047a50b0f.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="c2a476ba857c092560eaf9cd7e36a61e"
dest_md5="f8020647c3a0ecd5682ed4d7174789b3"

Binary file not shown.
12 changes: 12 additions & 0 deletions Chore1.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends Path2D

func _ready():
$VisibilityNotifier2D.connect("screen_entered",self,"start_play",[],CONNECT_ONESHOT)

func start_play():
get_parent().remove_child(self)
Globals.camera.add_child(self)
self.position=Vector2()
$AnimationPlayer.play("follow")
yield($AnimationPlayer,"animation_finished")
queue_free()
72 changes: 72 additions & 0 deletions Chore1.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://Chore1.gd" type="Script" id=1]
[ext_resource path="res://EnemySaucerBlue.tscn" type="PackedScene" id=2]

[sub_resource type="Curve2D" id=1]
_data = {
"points": PoolVector2Array( 0, 0, 0, 0, 74, -163, -54.6418, -90.2777, 54.6418, 90.2777, 219, 57, 0, -180.555, 0, 180.555, 928, 173, -21.3816, -159.174, 21.3816, 159.174, 129, 384, -73.6476, -87.902, 73.6476, 87.902, 889, 537, 0, 0, 0, 0, 903, 726 )
}

[sub_resource type="Animation" id=2]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("PathFollow2D:offset")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("PathFollow2D:unit_offset")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}

[sub_resource type="Animation" id=3]
resource_name = "follow"
length = 5.0
tracks/0/type = "value"
tracks/0/path = NodePath("PathFollow2D:unit_offset")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 0.0, 1.0 ]
}

[node name="Chore1" type="Path2D"]
curve = SubResource( 1 )
script = ExtResource( 1 )

[node name="PathFollow2D" type="PathFollow2D" parent="."]
position = Vector2( 74, -163 )
rotation = 1.58874
rotate = false
loop = false

[node name="EnemySaucerBlue" parent="PathFollow2D" instance=ExtResource( 2 )]

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 2 )
anims/follow = SubResource( 3 )

[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
position = Vector2( 516, 640 )
scale = Vector2( 52.55, 8.225 )
10 changes: 10 additions & 0 deletions Enemy.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends KinematicBody2D

onready var explo_scn=preload("res://Explosion.tscn")

func hit(_strength):
var explo=explo_scn.instance()
get_tree().root.add_child(explo)
explo.global_position=global_position
Globals.add_points(150)
queue_free()
13 changes: 13 additions & 0 deletions EnemyBlue2.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://EnemyBlue4.tscn" type="PackedScene" id=1]
[ext_resource path="res://enemyBlue2.png" type="Texture" id=2]
[ext_resource path="res://EnemySwing.gd" type="Script" id=3]

[node name="EnemyBlue2" instance=ExtResource( 1 )]
script = ExtResource( 3 )
swing_radius = 128
swing_time = 4.0

[node name="EnemyBlue4" parent="." index="0"]
texture = ExtResource( 2 )
29 changes: 29 additions & 0 deletions EnemyBlue4.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://enemyBlue4.png" type="Texture" id=1]
[ext_resource path="res://LaserSpawner.tscn" type="PackedScene" id=2]
[ext_resource path="res://Enemy.gd" type="Script" id=3]
[ext_resource path="res://NodeDestroyer.tscn" type="PackedScene" id=4]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 39.5, 24.5 )

[node name="EnemyBlue4" type="KinematicBody2D"]
collision_layer = 6
collision_mask = 2
script = ExtResource( 3 )

[node name="EnemyBlue4" type="Sprite" parent="."]
texture = ExtResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( -0.5, -5.5 )
shape = SubResource( 1 )

[node name="LaserSpawner" parent="." instance=ExtResource( 2 )]
position = Vector2( 0, 68 )
rotation = 3.14159

[node name="NodeDestroyer" parent="." instance=ExtResource( 4 )]
position = Vector2( 1, -2 )
scale = Vector2( 6.1, 5.7 )
4 changes: 4 additions & 0 deletions EnemySaucerBlue.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends "res://Enemy.gd"

func _process(delta):
rotate(delta*TAU/3)
23 changes: 23 additions & 0 deletions EnemySaucerBlue.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[gd_scene load_steps=5 format=2]

[ext_resource path="res://EnemyBlue4.tscn" type="PackedScene" id=1]
[ext_resource path="res://EnemySaucerBlue.gd" type="Script" id=2]
[ext_resource path="res://ufoBlue.png" type="Texture" id=3]
[ext_resource path="res://LaserSpawner.tscn" type="PackedScene" id=4]

[node name="EnemySaucerBlue" instance=ExtResource( 1 )]
script = ExtResource( 2 )

[node name="EnemyBlue4" parent="." index="0"]
texture = ExtResource( 3 )

[node name="LaserSpawner2" parent="." index="4" instance=ExtResource( 4 )]
position = Vector2( -76, 0 )
rotation = 4.71239

[node name="LaserSpawner3" parent="." index="5" instance=ExtResource( 4 )]
position = Vector2( 83, 0 )
rotation = 1.5708

[node name="LaserSpawner4" parent="." index="6" instance=ExtResource( 4 )]
position = Vector2( 0, -71 )
13 changes: 13 additions & 0 deletions EnemySwing.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends "res://Enemy.gd"

var start_position

export(int) var swing_radius=128
export(float) var swing_time=4.0

func _ready():
start_position=position


func _process(delta):
position.x=start_position.x+cos(fmod(Time.get_ticks_msec()/swing_time,1000)/1000.0*TAU)*swing_radius
7 changes: 7 additions & 0 deletions Explosion.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends Particles2D


func _ready():
emitting=true
yield(get_tree().create_timer(1),"timeout")
queue_free()
38 changes: 38 additions & 0 deletions Explosion.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://Explosion.gd" type="Script" id=1]
[ext_resource path="res://explosion.wav" type="AudioStream" id=2]

[sub_resource type="Gradient" id=1]
interpolation_mode = 2
offsets = PoolRealArray( 0.464567, 0.944882 )
colors = PoolColorArray( 0.951172, 1, 0, 1, 1, 0.0644531, 0, 1 )

[sub_resource type="GradientTexture" id=2]
gradient = SubResource( 1 )

[sub_resource type="ParticlesMaterial" id=3]
emission_shape = 1
emission_sphere_radius = 1.0
flag_disable_z = true
direction = Vector3( 0, 0, 0 )
spread = 180.0
gravity = Vector3( 0, 0, 0 )
orbit_velocity = 0.0
orbit_velocity_random = 0.0
radial_accel = 100.0
damping = 100.0
damping_random = 1.0
color_ramp = SubResource( 2 )

[node name="Explosion" type="Particles2D"]
emitting = false
amount = 200
one_shot = true
explosiveness = 0.5
process_material = SubResource( 3 )
script = ExtResource( 1 )

[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 2 )
autoplay = true
4 changes: 4 additions & 0 deletions ForwardCamera.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Camera2D

func _process(delta):
position.y=position.y-128*delta
11 changes: 11 additions & 0 deletions Globals.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends Node

signal score_changed(old_score,new_score)

var camera:Camera2D=null
var score=0

func add_points(points):
var old_score=score
score=score+points
emit_signal("score_changed",old_score,score)
12 changes: 12 additions & 0 deletions Laser.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends Area2D

func _ready():
connect("body_entered",self,"body_entered")

func _process(delta):
position=position+Vector2.UP.rotated(rotation)*512*delta

func body_entered(tutu):
if tutu.has_method("hit"):
tutu.hit(1)
queue_free()
24 changes: 24 additions & 0 deletions LaserBlue.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[gd_scene load_steps=5 format=2]

[ext_resource path="res://laserBlue02.png" type="Texture" id=1]
[ext_resource path="res://Laser.gd" type="Script" id=2]
[ext_resource path="res://NodeDestroyer.tscn" type="PackedScene" id=3]

[sub_resource type="CapsuleShape2D" id=1]
radius = 6.0
height = 24.0

[node name="LaserBlue" type="Area2D"]
collision_layer = 6
collision_mask = 2
script = ExtResource( 2 )

[node name="LaserBlue02" type="Sprite" parent="."]
texture = ExtResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )

[node name="NodeDestroyer" parent="." instance=ExtResource( 3 )]
position = Vector2( 0, 0.5 )
scale = Vector2( 1, 2.25 )
11 changes: 11 additions & 0 deletions LaserRed.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://laserRed02.png" type="Texture" id=1]
[ext_resource path="res://LaserBlue.tscn" type="PackedScene" id=2]

[node name="LaserRed" instance=ExtResource( 2 )]
collision_layer = 9
collision_mask = 1

[node name="LaserBlue02" parent="." index="0"]
texture = ExtResource( 1 )
16 changes: 16 additions & 0 deletions LaserSpawner.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends Position2D

onready var laser_red_scn=preload("res://LaserRed.tscn")

func _ready():
$VisibilityNotifier2D.connect("screen_entered",self,"connect_timer",[],CONNECT_ONESHOT)

func connect_timer():
$Timer.connect("timeout",self,"_on_Timer_timeout")

func _on_Timer_timeout():
if $VisibilityNotifier2D.is_on_screen():
var laser=laser_red_scn.instance()
get_tree().root.add_child(laser)
laser.global_position=global_position
laser.rotation=global_rotation
11 changes: 11 additions & 0 deletions LaserSpawner.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://LaserSpawner.gd" type="Script" id=1]

[node name="LaserSpawner" type="Position2D"]
script = ExtResource( 1 )

[node name="Timer" type="Timer" parent="."]
autostart = true

[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
13 changes: 13 additions & 0 deletions Level.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends Node

onready var rtf_score=$"%RtScore"

func _ready():
Globals.camera=$ForwardCamera
Globals.connect("score_changed",self,"score_changed")

func score_changed(old_score,new_score):
create_tween().tween_method(self,"update_score",old_score,new_score,1)

func update_score(value):
rtf_score.bbcode_text="[right][rainbow][wave]SCORE: %d[/wave][/rainbow][/right]" % [value]
Loading

0 comments on commit 95a4f2c

Please sign in to comment.