Initial commit
32
README.md
|
@ -1,2 +1,32 @@
|
|||
# evospace
|
||||
Short and noob friendly bullet hell for GBJAM 8
|
||||
Short and noob friendly bullet hell for [GBJAM 8](https://itch.io/jam/gbjam-8)
|
||||
|
||||
## Controls:
|
||||
|
||||
* Arrow Keys - Movement
|
||||
* Z - Shooting
|
||||
* X - Bomb
|
||||
|
||||
## Colors used:
|
||||
* #000000
|
||||
* #4D4D4D
|
||||
* #999999
|
||||
* #FFFFFF
|
||||
|
||||
## Extra Info:
|
||||
* You have 3 lives and 120 seconds to survive an ongoing assault.
|
||||
* You get 3 bombs and no extras, bombs destroy all enemies on screen so use them carefully
|
||||
* At 10.000 points you get an extra life
|
||||
* At the end of the round every life you still have will grant 2000 points and every bomb 1000 points
|
||||
* Enemies will drop 2 types of power ups:
|
||||
* Double - shoots 2 lasers with the same power and slightly faster cooldown
|
||||
* Fast - shoots 1 laser without cooldown but significantly less damage than the standard laser
|
||||
|
||||
## Credits :
|
||||
|
||||
Ships and asteroids are recolorings and at times slightly changed versions of Kenney's Space Shooter Redux pack:
|
||||
[https://www.kenney.nl/assets/space-shooter-redux](https://www.kenney.nl/assets/space-shooter-redux)
|
||||
|
||||
Name taken from Fantasy Name Generators website:
|
||||
[https://www.fantasynamegenerators.com/video-game-names.php](https://www.fantasynamegenerators.com/video-game-names.php)
|
||||
|
After Width: | Height: | Size: 231 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/avenger.png-e1dc08e70c6a7b4dbe97994572bffa1a.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/avenger/avenger.png"
|
||||
dest_files=[ "res://.import/avenger.png-e1dc08e70c6a7b4dbe97994572bffa1a.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,15 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
var damage = 1.0
|
||||
var velocity = Vector2()
|
||||
|
||||
func _physics_process(delta):
|
||||
var collision_info = move_and_collide(velocity)
|
||||
if collision_info:
|
||||
var collision_point = collision_info.position
|
||||
if(collision_info.collider is Enemy):
|
||||
(collision_info.collider as Enemy).damage(damage)
|
||||
queue_free()
|
||||
|
||||
func _on_visiblity_notifier_screen_exited():
|
||||
queue_free()
|
After Width: | Height: | Size: 87 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bullet.png-d3dacc23214f2cfa8a4bbd8885492f1f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/bullet/bullet.png"
|
||||
dest_files=[ "res://.import/bullet.png-d3dacc23214f2cfa8a4bbd8885492f1f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,26 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://entities/bullet/bullet.gd" type="Script" id=1]
|
||||
[ext_resource path="res://entities/bullet/bullet.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 0.98407
|
||||
height = 6.88478
|
||||
|
||||
[node name="bullet" type="KinematicBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 6
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="bullet_texture" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="bullet_collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
scale = Vector2( 0.313677, 0.677623 )
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
|
@ -0,0 +1,55 @@
|
|||
extends KinematicBody2D
|
||||
class_name Enemy
|
||||
|
||||
export (float) var health = 1.0
|
||||
export (int) var points = 1
|
||||
export (float) var powerup_drop_chance = 0.1
|
||||
export (Resource) var explosion = load("objects/explosion/explosion.tscn")
|
||||
|
||||
var velocity = Vector2()
|
||||
var rng = RandomNumberGenerator.new()
|
||||
var player
|
||||
var powerups = [
|
||||
preload("res://entities/powerups/double/double.tscn"),
|
||||
preload("res://entities/powerups/laser/laser.tscn")
|
||||
]
|
||||
var collision_info
|
||||
var level
|
||||
|
||||
func _ready():
|
||||
player = get_tree().get_root().get_node("level/player")
|
||||
rng.randomize()
|
||||
explosion = explosion.instance()
|
||||
level = get_parent()
|
||||
|
||||
func _physics_process(delta):
|
||||
if collision_info:
|
||||
var collision_point = collision_info.position
|
||||
if(collision_info.collider is Player):
|
||||
(collision_info.collider as Player).kill()
|
||||
explosion.position = position
|
||||
level.add_child(explosion)
|
||||
queue_free()
|
||||
|
||||
func damage(damage: float):
|
||||
health -= damage
|
||||
if health <= 0:
|
||||
kill(true)
|
||||
|
||||
func kill(get_points: bool = false):
|
||||
if get_points:
|
||||
player.increase_score(points)
|
||||
explosion.position = position
|
||||
level.add_child(explosion)
|
||||
# Worth noting: meteorites are not spawned as part of the wave but instead as part of the root element, which means their "level" won't have the
|
||||
# kill_enemy method, which in turn avoids waves being finished early by destroying meteorites instead of the wave spawns
|
||||
if level.has_method("kill_enemy"):
|
||||
level.kill_enemy()
|
||||
if rng.randf() < powerup_drop_chance:
|
||||
var powerup = powerups[rng.randi_range(0, powerups.size() - 1)].instance()
|
||||
powerup.position = position
|
||||
level.add_child(powerup)
|
||||
queue_free()
|
||||
|
||||
func _on_visiblity_notifier_screen_exited():
|
||||
queue_free()
|
After Width: | Height: | Size: 162 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/meteor_big_1.png-79015b610b84a7d1f856ad62f5a3a440.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/meteorite/meteor_big_1.png"
|
||||
dest_files=[ "res://.import/meteor_big_1.png-79015b610b84a7d1f856ad62f5a3a440.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 153 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/meteor_big_2.png-7b908137aa9e737d444eb33ccf4e97b4.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/meteorite/meteor_big_2.png"
|
||||
dest_files=[ "res://.import/meteor_big_2.png-7b908137aa9e737d444eb33ccf4e97b4.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 162 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/meteor_big_3.png-88972c75241a59c653113008a9f5c126.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/meteorite/meteor_big_3.png"
|
||||
dest_files=[ "res://.import/meteor_big_3.png-88972c75241a59c653113008a9f5c126.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 114 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/meteor_small_1.png-488b0e9052fe2cc0932e865e2f2ab209.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/meteorite/meteor_small_1.png"
|
||||
dest_files=[ "res://.import/meteor_small_1.png-488b0e9052fe2cc0932e865e2f2ab209.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 111 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/meteor_small_2.png-dcb5926c9e74393651b4436306efc89d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/meteorite/meteor_small_2.png"
|
||||
dest_files=[ "res://.import/meteor_small_2.png-dcb5926c9e74393651b4436306efc89d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 114 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/meteor_small_3.png-163e6a0d72c1e9574b601933db5ace9a.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/meteorite/meteor_small_3.png"
|
||||
dest_files=[ "res://.import/meteor_small_3.png-163e6a0d72c1e9574b601933db5ace9a.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,19 @@
|
|||
extends "../enemy.gd"
|
||||
|
||||
var rotation_speed
|
||||
var meteorite_size
|
||||
# Number of textures available, for the sake of simplicity both small and large meteorites have the same number of textures
|
||||
const TEXTURES = 3
|
||||
|
||||
func _ready():
|
||||
meteorite_size = rng.randi_range(0, 1)
|
||||
velocity.y = rng.randf_range(0.2, 0.5)
|
||||
velocity.x = rng.randf_range(-0.02, 0.02)
|
||||
var rand_texture = rng.randi_range(1, TEXTURES)
|
||||
var meteorite_texture = load(str("res://entities/meteorite/meteor_", ("big" if meteorite_size == 1 else "small") ,"_", rand_texture, ".png"))
|
||||
get_node("texture").texture = meteorite_texture
|
||||
rotation_speed = rng.randf_range(-2, 2)
|
||||
|
||||
func _physics_process(delta):
|
||||
rotation += rotation_speed * delta
|
||||
collision_info = move_and_collide(velocity)
|
|
@ -0,0 +1,28 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://entities/meteorite/meteor_big_1.png" type="Texture" id=1]
|
||||
[ext_resource path="res://entities/meteorite/meteorite.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 6.0
|
||||
|
||||
[node name="meteorite" type="KinematicBody2D" groups=[
|
||||
"Enemies",
|
||||
]]
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
points = 10
|
||||
powerup_drop_chance = 0.01
|
||||
|
||||
[node name="texture" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
|
@ -0,0 +1,15 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
var damage = 1.0
|
||||
var velocity = Vector2()
|
||||
|
||||
func _physics_process(delta):
|
||||
var collision_info = move_and_collide(velocity)
|
||||
if collision_info:
|
||||
var collision_point = collision_info.position
|
||||
if(collision_info.collider is Player):
|
||||
(collision_info.collider as Player).kill()
|
||||
queue_free()
|
||||
|
||||
func _on_visiblity_notifier_screen_exited():
|
||||
queue_free()
|
After Width: | Height: | Size: 111 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/pellett.png-7761fcbb1c76550f372176a149794ae3.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/pellett/pellett.png"
|
||||
dest_files=[ "res://.import/pellett.png-7761fcbb1c76550f372176a149794ae3.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,22 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://entities/pellett/pellett.png" type="Texture" id=1]
|
||||
[ext_resource path="res://entities/pellett/pellett.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 2.33548
|
||||
|
||||
[node name="pellett" type="KinematicBody2D" groups=[
|
||||
"Enemies",
|
||||
]]
|
||||
collision_layer = 16
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="texture" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
|
@ -0,0 +1,119 @@
|
|||
extends KinematicBody2D
|
||||
class_name Player
|
||||
|
||||
export (float) var speed = 1.3
|
||||
export (Resource) var weapon = load("weapons/default/default.tscn")
|
||||
export (int) var lives = 2
|
||||
export (int) var bombs = 3
|
||||
|
||||
var velocity = Vector2()
|
||||
var score = 0
|
||||
var hiscore = 0
|
||||
var hud
|
||||
var iframe = false
|
||||
onready var iframe_timer = $iframe_timer
|
||||
onready var sprite = $sprite
|
||||
var explosion_resource = preload("res://objects/explosion/explosion.tscn")
|
||||
var collision_info
|
||||
var game_over_screen = preload("res://ui/game_over/game_over.tscn")
|
||||
var level
|
||||
var extra_lives = 0
|
||||
|
||||
func _ready():
|
||||
level = get_tree().get_root().get_node("level")
|
||||
hud = get_parent().get_node("hud")
|
||||
update_weapon()
|
||||
|
||||
func _physics_process(delta):
|
||||
get_input()
|
||||
collision_info = move_and_collide(velocity)
|
||||
if collision_info:
|
||||
if collision_info.collider.has_method("kill"):
|
||||
collision_info.collider.kill()
|
||||
kill()
|
||||
if collision_info.collider.has_method("reward"):
|
||||
collision_info.collider.reward(self)
|
||||
|
||||
func get_input():
|
||||
velocity = Vector2()
|
||||
if Input.is_action_pressed("ui_right") && position.x < ProjectSettings.get("display/window/size/width") - 9:
|
||||
velocity.x += 1
|
||||
if Input.is_action_pressed("ui_left") && position.x > 10:
|
||||
velocity.x -= 1
|
||||
if Input.is_action_pressed("ui_up") && position.y > 7:
|
||||
velocity.y -= 1
|
||||
if Input.is_action_pressed("ui_down") && position.y < ProjectSettings.get("display/window/size/height") - 16:
|
||||
velocity.y += 1
|
||||
velocity = velocity.normalized() * speed
|
||||
|
||||
if Input.is_action_pressed("player_shoot"):
|
||||
shoot()
|
||||
elif Input.is_action_just_pressed("player_special"):
|
||||
special()
|
||||
|
||||
if Input.is_key_pressed(KEY_1):
|
||||
weapon = load("weapons/default/default.tscn")
|
||||
update_weapon()
|
||||
if Input.is_key_pressed(KEY_2):
|
||||
weapon = load("weapons/double/double.tscn")
|
||||
update_weapon()
|
||||
if Input.is_key_pressed(KEY_3):
|
||||
weapon = load("weapons/laser/laser.tscn")
|
||||
update_weapon()
|
||||
|
||||
func shoot():
|
||||
if weapon.has_method("shoot"):
|
||||
weapon.shoot()
|
||||
|
||||
func special():
|
||||
if bombs <= 0:
|
||||
return
|
||||
bombs -= 1
|
||||
for node in get_tree().get_nodes_in_group("Enemies"):
|
||||
if node.has_method("kill"):
|
||||
node.kill(true)
|
||||
else:
|
||||
node.queue_free()
|
||||
|
||||
func update_weapon():
|
||||
if weapon.get_class() != "PackedScene":
|
||||
weapon.queue_free()
|
||||
weapon = weapon.instance()
|
||||
weapon.player = self
|
||||
add_child(weapon)
|
||||
|
||||
func increase_score(points):
|
||||
score += points
|
||||
if score / 10000 >= 1 + extra_lives:
|
||||
lives += 1
|
||||
extra_lives += 1
|
||||
hud.update_labels()
|
||||
|
||||
func kill(end_game: bool = false):
|
||||
if !iframe:
|
||||
lives -= 1
|
||||
hud.update_labels()
|
||||
iframe = true
|
||||
var explosion = explosion_resource.instance()
|
||||
explosion.position = position
|
||||
level.add_child(explosion)
|
||||
position = Vector2(80, 123)
|
||||
sprite.play("iframe")
|
||||
iframe_timer.start()
|
||||
if lives < 0 || end_game:
|
||||
score += bombs * 1000
|
||||
score += lives * 2000
|
||||
if hiscore == 0:
|
||||
hiscore = score
|
||||
elif score > hiscore:
|
||||
hiscore = score
|
||||
var game_over = game_over_screen.instance()
|
||||
game_over.score = score
|
||||
game_over.hiscore = hiscore
|
||||
level.queue_free()
|
||||
get_tree().get_root().add_child(game_over)
|
||||
|
||||
func _on_iframe_timer_timeout():
|
||||
iframe = false
|
||||
sprite.frame = 0
|
||||
sprite.stop()
|
|
@ -0,0 +1,36 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://entities/player/player_ship.png" type="Texture" id=1]
|
||||
[ext_resource path="res://entities/player/player.gd" type="Script" id=2]
|
||||
[ext_resource path="res://entities/player/player_ship_iframe.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 1 ), ExtResource( 3 ) ],
|
||||
"loop": true,
|
||||
"name": "iframe",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=2]
|
||||
radius = 2.42166
|
||||
height = 0.939134
|
||||
|
||||
[node name="player_ship" type="KinematicBody2D"]
|
||||
collision_mask = 2147483660
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="sprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 1 )
|
||||
animation = "iframe"
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -0.0910168, 3.14083 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="iframe_timer" type="Timer" parent="."]
|
||||
wait_time = 3.0
|
||||
[connection signal="timeout" from="iframe_timer" to="." method="_on_iframe_timer_timeout"]
|
After Width: | Height: | Size: 192 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/player_ship.png-76cc9570d03ee0d2b47c69cb84bafbe9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/player/player_ship.png"
|
||||
dest_files=[ "res://.import/player_ship.png-76cc9570d03ee0d2b47c69cb84bafbe9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 186 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/player_ship_iframe.png-b0fb3f525a5c61eb569d97389ead1e0e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/player/player_ship_iframe.png"
|
||||
dest_files=[ "res://.import/player_ship_iframe.png-b0fb3f525a5c61eb569d97389ead1e0e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 114 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/double.png-77adf9538a38c9c819e0c5e87fbc5f82.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/powerups/double/double.png"
|
||||
dest_files=[ "res://.import/double.png-77adf9538a38c9c819e0c5e87fbc5f82.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://entities/powerups/double/double.png" type="Texture" id=1]
|
||||
[ext_resource path="res://entities/powerups/powerup.gd" type="Script" id=2]
|
||||
[ext_resource path="res://weapons/double/double.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 4.91787
|
||||
|
||||
[node name="powerup" type="KinematicBody2D"]
|
||||
collision_layer = 8
|
||||
collision_mask = 8
|
||||
script = ExtResource( 2 )
|
||||
weapon = ExtResource( 3 )
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="texture" type="Sprite" parent="."]
|
||||
position = Vector2( -0.0625, 0.75 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
After Width: | Height: | Size: 120 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/laser.png-3d3e2fdc2b041edf05a8817a5670b160.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/powerups/laser/laser.png"
|
||||
dest_files=[ "res://.import/laser.png-3d3e2fdc2b041edf05a8817a5670b160.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://weapons/laser/laser.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://entities/powerups/powerup.gd" type="Script" id=2]
|
||||
[ext_resource path="res://entities/powerups/laser/laser.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 4.91787
|
||||
|
||||
[node name="powerup" type="KinematicBody2D"]
|
||||
collision_layer = 8
|
||||
collision_mask = 8
|
||||
script = ExtResource( 2 )
|
||||
weapon = ExtResource( 1 )
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="texture" type="Sprite" parent="."]
|
||||
position = Vector2( -0.0625, 0.75 )
|
||||
texture = ExtResource( 3 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
|
@ -0,0 +1,36 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
export (Resource) var weapon
|
||||
|
||||
var rng = RandomNumberGenerator.new()
|
||||
var speed
|
||||
var velocity = Vector2(0, 0.2)
|
||||
var dir = 0
|
||||
|
||||
func _ready():
|
||||
rng.randomize()
|
||||
speed = rng.randf_range(0.2, 0.8)
|
||||
velocity.x = speed
|
||||
|
||||
func _physics_process(delta):
|
||||
|
||||
if dir == 0 && position.x > ProjectSettings.get("display/window/size/width") - 8:
|
||||
dir = 1
|
||||
velocity.x = -speed
|
||||
elif dir == 1 && position.x < 8:
|
||||
dir = 0
|
||||
velocity.x = speed
|
||||
|
||||
var collision_info = move_and_collide(velocity)
|
||||
if collision_info && collision_info.collider is Player:
|
||||
var player = (collision_info.collider as Player)
|
||||
reward(player)
|
||||
|
||||
func _on_visiblity_notifier_screen_exited():
|
||||
queue_free()
|
||||
|
||||
func reward(player):
|
||||
player.weapon = weapon
|
||||
player.update_weapon()
|
||||
player.increase_score(50)
|
||||
queue_free()
|
|
@ -0,0 +1,48 @@
|
|||
extends "../enemy.gd"
|
||||
|
||||
export (int) var pellett_count = 10
|
||||
export (int) var pellett_radius = 10
|
||||
export (float) var pellett_speed = 0.6
|
||||
export (int) var pellett_rows_per_wave = 3
|
||||
export (int) var pellet_waves = 3
|
||||
|
||||
var shoot_timer = Timer.new()
|
||||
var phase = -1
|
||||
var max_phase
|
||||
var pellett = preload("res://entities/pellett/pellett.tscn")
|
||||
|
||||
func _ready():
|
||||
shoot_timer.one_shot = true
|
||||
shoot_timer.wait_time = 0.5
|
||||
add_child(shoot_timer)
|
||||
max_phase = pellet_waves * pellett_rows_per_wave
|
||||
|
||||
func _process(delta):
|
||||
if shoot_timer.is_stopped() && phase >= 0 && phase <= max_phase:
|
||||
if phase % pellett_rows_per_wave == 0:
|
||||
shoot_timer.wait_time = 3.5
|
||||
else:
|
||||
shoot_timer.wait_time = 0.5
|
||||
phase += 1
|
||||
var angle_step = 2.0 * PI / pellett_count
|
||||
var angle = 0
|
||||
for i in range(0, pellett_count):
|
||||
var direction = Vector2(cos(angle), sin(angle))
|
||||
var pos = position + direction * pellett_radius
|
||||
var pellett_shot = pellett.instance()
|
||||
pellett_shot.position = pos
|
||||
angle += angle_step
|
||||
pellett_shot.velocity = direction * pellett_speed
|
||||
level.add_child(pellett_shot)
|
||||
shoot_timer.start()
|
||||
|
||||
func _physics_process(delta):
|
||||
if phase == -1 && position.y < 40:
|
||||
velocity.y = 0.8
|
||||
elif phase == - 1:
|
||||
phase = 1
|
||||
velocity = Vector2(0, 0)
|
||||
|
||||
if shoot_timer.is_stopped() && phase >= max_phase - 1:
|
||||
velocity.y = 0.8
|
||||
collision_info = move_and_collide(velocity)
|
After Width: | Height: | Size: 198 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ufo.png-d3ce4f8a286f2884389b78b67c03ea69.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/ufo/ufo.png"
|
||||
dest_files=[ "res://.import/ufo.png-d3ce4f8a286f2884389b78b67c03ea69.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,28 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://entities/ufo/ufo.png" type="Texture" id=1]
|
||||
[ext_resource path="res://entities/ufo/ufo.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 9.50289
|
||||
|
||||
[node name="ufo" type="KinematicBody2D" groups=[
|
||||
"Enemies",
|
||||
]]
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
health = 5.0
|
||||
points = 100
|
||||
|
||||
[node name="texture" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
|
@ -0,0 +1,18 @@
|
|||
extends "../enemy.gd"
|
||||
|
||||
export (int) var speed = 0.1
|
||||
|
||||
var target: Vector2
|
||||
|
||||
func _ready():
|
||||
target = player.position
|
||||
rotation = position.angle_to_point(target) + 1.5707
|
||||
|
||||
func _physics_process(delta):
|
||||
position = position.move_toward(target, delta * speed)
|
||||
if position == target:
|
||||
if get_parent().has_method("kill_enemy"):
|
||||
get_parent().kill_enemy()
|
||||
explosion.position = position
|
||||
level.add_child(explosion)
|
||||
queue_free()
|
After Width: | Height: | Size: 216 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/viper.png-7020651a6664ca874e9a97046da0e68c.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/viper/viper.png"
|
||||
dest_files=[ "res://.import/viper.png-7020651a6664ca874e9a97046da0e68c.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,26 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.gd" type="Script" id=1]
|
||||
[ext_resource path="res://entities/viper/viper.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 7.74215
|
||||
|
||||
[node name="viper" type="KinematicBody2D" groups=[
|
||||
"Enemies",
|
||||
]]
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
script = ExtResource( 1 )
|
||||
points = 150
|
||||
powerup_drop_chance = 0.05
|
||||
speed = 100
|
||||
|
||||
[node name="texture" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="visiblity_notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="screen_exited" from="visiblity_notifier" to="." method="_on_visiblity_notifier_screen_exited"]
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
|
@ -0,0 +1,48 @@
|
|||
extends Node2D
|
||||
|
||||
var game_state = {}
|
||||
|
||||
func _ready():
|
||||
load_game()
|
||||
|
||||
func save_game():
|
||||
var save_file = File.new()
|
||||
save_file.open("user://savegame.dat", File.WRITE)
|
||||
save_file.store_line(to_json(game_state))
|
||||
save_file.close()
|
||||
|
||||
func load_game():
|
||||
var save_file = File.new()
|
||||
if not save_file.file_exists("user://savegame.dat"):
|
||||
return # Error! We don't have a save to load.
|
||||
|
||||
# Load the file line by line and process that dictionary to restore
|
||||
# the object it represents.
|
||||
save_file.open("user://savegame.dat", File.READ)
|
||||
while save_file.get_position() < save_file.get_len():
|
||||
# Get the saved dictionary from the next line in the save file
|
||||
var node_data = parse_json(save_file.get_line())
|
||||
|
||||
for key in node_data.keys():
|
||||
game_state[key] = node_data[key]
|
||||
|
||||
save_file.close()
|
||||
|
||||
func get_hiscores():
|
||||
if !game_state.has("hiscores"):
|
||||
return []
|
||||
game_state["hiscores"].sort_custom(self, "score_sort")
|
||||
game_state["hiscores"].invert()
|
||||
return global.game_state["hiscores"]
|
||||
|
||||
func get_highest_score():
|
||||
if !game_state.has("hiscores"):
|
||||
return ["", 0]
|
||||
game_state["hiscores"].sort_custom(self, "score_sort")
|
||||
game_state["hiscores"].invert()
|
||||
return game_state["hiscores"][0]
|
||||
|
||||
func score_sort(a, b):
|
||||
if a[1] < b[1]:
|
||||
return true
|
||||
return false
|
|
@ -0,0 +1,54 @@
|
|||
[gd_scene load_steps=19 format=2]
|
||||
|
||||
[ext_resource path="res://entities/player/player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://entities/meteorite/meteorite.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://levels/level.gd" type="Script" id=3]
|
||||
[ext_resource path="res://ui/background.png" type="Texture" id=4]
|
||||
[ext_resource path="res://weapons/default/default.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://ui/hud/hud.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://objects/spawner/spawner.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://levels/waves/two_ufo_easy.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://levels/waves/one_ufo.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://levels/waves/one_viper_02.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://levels/waves/three_viper_01.tscn" type="PackedScene" id=11]
|
||||
[ext_resource path="res://levels/waves/one_viper_03.tscn" type="PackedScene" id=12]
|
||||
[ext_resource path="res://levels/waves/two_viper_01.tscn" type="PackedScene" id=13]
|
||||
[ext_resource path="res://levels/waves/one_viper_01.tscn" type="PackedScene" id=14]
|
||||
[ext_resource path="res://levels/waves/two_ufo_hard.tscn" type="PackedScene" id=15]
|
||||
[ext_resource path="res://levels/waves/two_viper_02.tscn" type="PackedScene" id=16]
|
||||
[ext_resource path="res://levels/waves/two_viper_03.tscn" type="PackedScene" id=17]
|
||||
[ext_resource path="res://levels/waves/one_viper_one_ufo_01.tscn" type="PackedScene" id=18]
|
||||
|
||||
[node name="level" type="Node2D"]
|
||||
script = ExtResource( 3 )
|
||||
waves = [ ExtResource( 9 ), ExtResource( 8 ), ExtResource( 14 ), ExtResource( 10 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 13 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 15 ), ExtResource( 18 ) ]
|
||||
|
||||
[node name="player" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 80, 123 )
|
||||
weapon = ExtResource( 5 )
|
||||
|
||||
[node name="background" type="Sprite" parent="."]
|
||||
position = Vector2( 80, 72 )
|
||||
scale = Vector2( 22, 20 )
|
||||
z_index = -100
|
||||
texture = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="ui_background" type="Sprite" parent="."]
|
||||
position = Vector2( 80, 144 )
|
||||
scale = Vector2( 22, 2 )
|
||||
z_index = 100
|
||||
texture = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="hud" parent="." instance=ExtResource( 6 )]
|
||||
|
||||
[node name="spawner" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 79.9553, -17.2909 )
|
||||
spawn_type = ExtResource( 2 )
|
||||
maximum_spawns = -1
|
||||
spawn_interval = 5.0
|
|
@ -0,0 +1,19 @@
|
|||
extends Node
|
||||
|
||||
export (Array, PackedScene) var waves
|
||||
|
||||
var rng = RandomNumberGenerator.new()
|
||||
var passed_waves = 0
|
||||
var wave
|
||||
var level
|
||||
|
||||
func _ready():
|
||||
level = get_tree().get_root().get_node("level")
|
||||
rng.randomize()
|
||||
next_wave()
|
||||
|
||||
func next_wave():
|
||||
wave = waves[rng.randi_range(0, waves.size() - 1)].instance()
|
||||
wave.level = self
|
||||
level.call_deferred("add_child", wave)
|
||||
passed_waves += 1
|
|
@ -0,0 +1,21 @@
|
|||
extends Node
|
||||
|
||||
export (int) var number_of_enemies = 0
|
||||
|
||||
var level
|
||||
var timer = Timer.new()
|
||||
|
||||
func _ready():
|
||||
timer.one_shot = true
|
||||
timer.wait_time = 5
|
||||
add_child(timer)
|
||||
|
||||
func _process(delta):
|
||||
if number_of_enemies <= 0 && timer.is_stopped():
|
||||
queue_free()
|
||||
|
||||
func kill_enemy():
|
||||
number_of_enemies -= 1
|
||||
if number_of_enemies == 0:
|
||||
level.next_wave()
|
||||
timer.start()
|
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/ufo/ufo.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 1
|
||||
|
||||
[node name="ufo" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 80, -8 )
|
||||
powerup_drop_chance = 0.3
|
||||
pellett_count = 20
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 1
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 77.161, -14.4438 )
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 1
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 28.389, -33.364 )
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 1
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 119.206, -37.9889 )
|
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
[ext_resource path="res://entities/ufo/ufo.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 2
|
||||
|
||||
[node name="ufo" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 30.551, -22.7119 )
|
||||
pellett_count = 20
|
||||
pellett_rows_per_wave = 5
|
||||
pellet_waves = 2
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 149.427, -12.5563 )
|
||||
speed = 120
|
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 3
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 172.182, -11.9211 )
|
||||
|
||||
[node name="viper2" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( -13.2354, -11.0803 )
|
||||
|
||||
[node name="viper3" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 79.2632, -11.0803 )
|
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/ufo/ufo.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 2
|
||||
|
||||
[node name="ufo2" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 120, -8 )
|
||||
pellett_count = 15
|
||||
|
||||
[node name="ufo" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 40, -8 )
|
||||
pellett_count = 15
|
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/ufo/ufo.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 2
|
||||
|
||||
[node name="ufo2" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 120, -8 )
|
||||
points = 200
|
||||
powerup_drop_chance = 0.3
|
||||
pellett_count = 30
|
||||
pellett_rows_per_wave = 5
|
||||
pellet_waves = 4
|
||||
|
||||
[node name="ufo" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 40, -8 )
|
||||
points = 200
|
||||
powerup_drop_chance = 0.3
|
||||
pellett_count = 30
|
||||
pellett_rows_per_wave = 5
|
||||
pellet_waves = 4
|
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 2
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 172.182, -11.9211 )
|
||||
|
||||
[node name="viper2" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( -13.2354, -11.0803 )
|
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 2
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 174.705, 133.134 )
|
||||
speed = 80
|
||||
|
||||
[node name="viper2" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( -15.7581, 134.395 )
|
||||
speed = 80
|
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://entities/viper/viper.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://levels/wave.gd" type="Script" id=2]
|
||||
|
||||
[node name="wave" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
number_of_enemies = 2
|
||||
|
||||
[node name="viper" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 80.5244, -14.444 )
|
||||
|
||||
[node name="viper2" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( -15.7581, 134.395 )
|
||||
speed = 80
|
|
@ -0,0 +1,7 @@
|
|||
extends AnimatedSprite
|
||||
|
||||
func _ready():
|
||||
playing = true
|
||||
|
||||
func _on_explosion_animation_finished():
|
||||
queue_free()
|
After Width: | Height: | Size: 765 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/explosion.png-8ff303fba58225a9b04a257c019728bb.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://objects/explosion/explosion.png"
|
||||
dest_files=[ "res://.import/explosion.png-8ff303fba58225a9b04a257c019728bb.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,49 @@
|
|||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://objects/explosion/explosion.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/explosion/explosion.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 16, 0, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 32, 0, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 16, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 16, 16, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 32, 16, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 32, 16, 16 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 16, 32, 16, 16 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=9]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
|
||||
"loop": false,
|
||||
"name": "default",
|
||||
"speed": 15.0
|
||||
} ]
|
||||
|
||||
[node name="explosion" type="AnimatedSprite"]
|
||||
frames = SubResource( 9 )
|
||||
script = ExtResource( 2 )
|
||||
[connection signal="animation_finished" from="." to="." method="_on_explosion_animation_finished"]
|
|
@ -0,0 +1,24 @@
|
|||
extends Node2D
|
||||
|
||||
export (Resource) var spawn_type
|
||||
export (int) var maximum_spawns
|
||||
export (float) var spawn_interval = 2
|
||||
|
||||
var spawn_timer = Timer.new()
|
||||
var spawns = 0
|
||||
var rng = RandomNumberGenerator.new()
|
||||
|
||||
func _ready():
|
||||
rng.randomize()
|
||||
spawn_timer.wait_time = spawn_interval
|
||||
spawn_timer.one_shot = true
|
||||
add_child(spawn_timer)
|
||||
|
||||
func _process(delta):
|
||||
if spawn_timer.is_stopped() && (maximum_spawns < 0 || spawns < maximum_spawns):
|
||||
var spawn = spawn_type.instance();
|
||||
spawn.position = position
|
||||
spawn.position.x = rng.randf_range(16, ProjectSettings.get("display/window/size/width") - 16)
|
||||
get_parent().add_child(spawn)
|
||||
spawns += 1
|
||||
spawn_timer.start()
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://objects/spawner/spawner.gd" type="Script" id=1]
|
||||
|
||||
[node name="spawner" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -0,0 +1,144 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "KinematicBody2D",
|
||||
"class": "Enemy",
|
||||
"language": "GDScript",
|
||||
"path": "res://entities/enemy.gd"
|
||||
}, {
|
||||
"base": "KinematicBody2D",
|
||||
"class": "Player",
|
||||
"language": "GDScript",
|
||||
"path": "res://entities/player/player.gd"
|
||||
}, {
|
||||
"base": "Node2D",
|
||||
"class": "Weapon",
|
||||
"language": "GDScript",
|
||||
"path": "res://weapons/weapon.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"Enemy": "",
|
||||
"Player": "",
|
||||
"Weapon": ""
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="ProjectGB8"
|
||||
run/main_scene="res://ui/main_menu/main_menu.tscn"
|
||||
|
||||
[autoload]
|
||||
|
||||
global="*res://globals/global.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
settings/stdout/print_fps=true
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=160
|
||||
window/size/height=144
|
||||
window/size/test_width=960
|
||||
window/size/test_height=864
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
ui_accept={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_select={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_cancel={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_focus_next={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_focus_prev={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_page_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_page_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_home={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
ui_end={
|
||||
"deadzone": 0.5,
|
||||
"events": [ ]
|
||||
}
|
||||
player_shoot={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_special={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":88,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="player"
|
||||
2d_physics/layer_2="bullets"
|
||||
2d_physics/layer_3="enemies"
|
||||
2d_physics/layer_4="powerups"
|
||||
|
||||
[logging]
|
||||
|
||||
file_logging/enable_file_logging=true
|
||||
|
||||
[rendering]
|
||||
|
||||
quality/driver/driver_name="GLES2"
|
||||
quality/2d/use_pixel_snap=true
|
||||
vram_compression/import_etc=true
|
||||
vram_compression/import_etc2=false
|
||||
environment/default_environment="res://globals/default_env.tres"
|
After Width: | Height: | Size: 78 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/background.png-2693c3f581a46c19cdd8c76a9b20c564.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/background.png"
|
||||
dest_files=[ "res://.import/background.png-2693c3f581a46c19cdd8c76a9b20c564.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 88 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/empty.png-56c872a0912f10abd246ce9aff82c0ed.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/empty.png"
|
||||
dest_files=[ "res://.import/empty.png-56c872a0912f10abd246ce9aff82c0ed.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,39 @@
|
|||
extends Control
|
||||
|
||||
onready var score_label = $score
|
||||
onready var hiscore_label = $hiscore
|
||||
onready var name_selector = $name_selector
|
||||
|
||||
var main_menu_screen = load("ui/main_menu/main_menu.tscn")
|
||||
|
||||
var score = 0
|
||||
var hiscore = 0
|
||||
var hiscores = []
|
||||
var global
|
||||
|
||||
func _ready():
|
||||
global = get_node("/root/global")
|
||||
|
||||
var hiscore_display = hiscore
|
||||
var highest_score = global.get_highest_score()[1]
|
||||
|
||||
if highest_score > hiscore:
|
||||
hiscore_display = highest_score
|
||||
|
||||
score_label.text = str("Score: ", score)
|
||||
hiscore_label.text = str("High Score: ", hiscore_display)
|
||||
hiscores = global.get_hiscores()
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("player_shoot"):
|
||||
hiscores.push_back([name_selector.get_name(), hiscore])
|
||||
global.game_state["hiscores"] = hiscores
|
||||
global.save_game()
|
||||
go_to_main_menu()
|
||||
elif Input.is_action_just_pressed("player_special"):
|
||||
go_to_main_menu()
|
||||
|
||||
func go_to_main_menu():
|
||||
var screen = main_menu_screen.instance()
|
||||
queue_free()
|
||||
get_tree().get_root().add_child(screen)
|
|
@ -0,0 +1,115 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://ui/pixelated_style.tres" type="StyleBox" id=1]
|
||||
[ext_resource path="res://ui/background.png" type="Texture" id=2]
|
||||
[ext_resource path="res://ui/Kenney Mini.ttf" type="DynamicFontData" id=3]
|
||||
[ext_resource path="res://ui/kenny_mini_8px.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://ui/name_selector/name_selector.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://ui/game_over/game_over.gd" type="Script" id=6]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
font_data = ExtResource( 3 )
|
||||
|
||||
[node name="game_over" type="Control" groups=[
|
||||
"Persistent",
|
||||
]]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="title" type="Label" parent="."]
|
||||
margin_left = 32.0
|
||||
margin_top = 32.0
|
||||
margin_right = 128.0
|
||||
margin_bottom = 52.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "GAME OVER"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="score" type="Label" parent="."]
|
||||
margin_left = 32.0
|
||||
margin_top = 56.0
|
||||
margin_right = 128.0
|
||||
margin_bottom = 66.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Score: 99999999"
|
||||
align = 2
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="next" type="Label" parent="."]
|
||||
margin_left = 4.91322
|
||||
margin_top = 117.755
|
||||
margin_right = 100.913
|
||||
margin_bottom = 140.755
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Z - Submit score
|
||||
X - Back to menu"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="hiscore" type="Label" parent="."]
|
||||
margin_left = 32.0
|
||||
margin_top = 72.0
|
||||
margin_right = 128.0
|
||||
margin_bottom = 82.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "High Score: 99999999"
|
||||
align = 2
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="LineEdit" parent="."]
|
||||
visible = false
|
||||
margin_left = 48.0
|
||||
margin_top = 88.0
|
||||
margin_right = 112.0
|
||||
margin_bottom = 102.0
|
||||
custom_styles/read_only = ExtResource( 1 )
|
||||
custom_styles/focus = ExtResource( 1 )
|
||||
custom_styles/normal = ExtResource( 1 )
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
custom_colors/font_color_selected = Color( 1, 1, 1, 1 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
align = 1
|
||||
max_length = 10
|
||||
placeholder_text = "Name"
|
||||
placeholder_alpha = 1.0
|
||||
caret_blink = true
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="background" type="Sprite" parent="."]
|
||||
position = Vector2( 80, 72 )
|
||||
scale = Vector2( 22, 20 )
|
||||
z_index = -100
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="name_selector" parent="." instance=ExtResource( 5 )]
|
||||
margin_left = 56.0
|
||||
margin_top = 88.0
|
||||
margin_right = 56.08
|
||||
margin_bottom = 88.0
|
|
@ -0,0 +1,22 @@
|
|||
extends Control
|
||||
|
||||
var main_menu_screen = load("ui/main_menu/main_menu.tscn")
|
||||
|
||||
func _ready():
|
||||
main_menu_screen = main_menu_screen.instance()
|
||||
var highscores = global.get_hiscores()
|
||||
for node in get_children():
|
||||
node.hide()
|
||||
var index = 0
|
||||
var scores = []
|
||||
for i in range(0, highscores.size()):
|
||||
get_child(i).show()
|
||||
var key = highscores[i][0]
|
||||
var score = highscores[i][1]
|
||||
scores.append(str(key, " - ", score))
|
||||
get_child(i).get_node("name").text = str(key, " - ", score)
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("player_special"):
|
||||
get_node("../../").queue_free()
|
||||
get_tree().get_root().add_child(main_menu_screen)
|
|
@ -0,0 +1,238 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://ui/Kenney Mini.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://ui/background.png" type="Texture" id=2]
|
||||
[ext_resource path="res://ui/kenny_mini_8px.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://ui/hiscores/highscores_list.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="hiscores" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="background" type="Sprite" parent="."]
|
||||
position = Vector2( 80, 72 )
|
||||
scale = Vector2( 22, 20 )
|
||||
z_index = -100
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="layer" type="CanvasLayer" parent="."]
|
||||
layer = 100
|
||||
|
||||
[node name="title" type="Label" parent="layer"]
|
||||
margin_left = 32.0
|
||||
margin_right = 128.0
|
||||
margin_bottom = 20.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "HIGHSCORES"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="back" type="Label" parent="layer"]
|
||||
margin_top = 128.0
|
||||
margin_right = 80.0
|
||||
margin_bottom = 138.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "X - back to menu"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="list" type="Control" parent="layer"]
|
||||
margin_left = 32.0
|
||||
margin_top = 16.0
|
||||
margin_right = 128.0
|
||||
margin_bottom = 128.0
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position_1" type="Control" parent="layer/list"]
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 16.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position" type="Label" parent="layer/list/position_1"]
|
||||
margin_right = 8.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "1."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="Label" parent="layer/list/position_1"]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "AAA - 99999999"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position_2" type="Control" parent="layer/list"]
|
||||
margin_left = 8.0
|
||||
margin_top = 24.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 32.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position" type="Label" parent="layer/list/position_2"]
|
||||
margin_right = 8.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "2."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="Label" parent="layer/list/position_2"]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "BBB - 99999999"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position_3" type="Control" parent="layer/list"]
|
||||
margin_left = 8.0
|
||||
margin_top = 40.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 48.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position" type="Label" parent="layer/list/position_3"]
|
||||
margin_right = 8.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "3."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="Label" parent="layer/list/position_3"]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "CCC - 99999999"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position_4" type="Control" parent="layer/list"]
|
||||
margin_left = 8.0
|
||||
margin_top = 56.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 64.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position" type="Label" parent="layer/list/position_4"]
|
||||
margin_right = 8.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "4."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="Label" parent="layer/list/position_4"]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "DDD - 99999999"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position_5" type="Control" parent="layer/list"]
|
||||
margin_left = 8.0
|
||||
margin_top = 72.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 80.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position" type="Label" parent="layer/list/position_5"]
|
||||
margin_right = 8.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "5."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="Label" parent="layer/list/position_5"]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "EEE - 99999999"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position_6" type="Control" parent="layer/list"]
|
||||
margin_left = 8.0
|
||||
margin_top = 88.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 96.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="position" type="Label" parent="layer/list/position_6"]
|
||||
margin_right = 8.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "6."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="name" type="Label" parent="layer/list/position_6"]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 10.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "FFF - 99999999"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
extends Control
|
||||
|
||||
onready var score_label: Label = $layer/score_label
|
||||
onready var bombs_label: Label = $layer/bombs_label
|
||||
onready var lives_label: Label = $layer/lives_label
|
||||
onready var timer_label: Label = $layer/timer_label
|
||||
onready var timer: Timer = $layer/timer_label/round_timer
|
||||
|
||||
var player
|
||||
|
||||
func _ready():
|
||||
player = get_parent().get_node("player")
|
||||
update_labels()
|
||||
|
||||
func _process(delta):
|
||||
timer_label.text = str("T: ", timer.time_left).pad_decimals(0)
|
||||
|
||||
func update_labels():
|
||||
score_label.text = str("Score: ", player.score).pad_zeros(8)
|
||||
lives_label.text = str(player.lives)
|
||||
bombs_label.text = str(player.bombs)
|
||||
|
||||
func _on_round_timer_timeout():
|
||||
player.kill(true)
|
|
@ -0,0 +1,86 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://ui/kenny_mini_8px.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://ui/life.png" type="Texture" id=2]
|
||||
[ext_resource path="res://ui/special.png" type="Texture" id=3]
|
||||
[ext_resource path="res://ui/hud/hud.gd" type="Script" id=4]
|
||||
|
||||
[node name="hud" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="layer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="score_label" type="Label" parent="layer"]
|
||||
margin_top = 134.0
|
||||
margin_right = 80.0
|
||||
margin_bottom = 144.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "Score: 00000000"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="lives_label" type="Label" parent="layer"]
|
||||
margin_left = 152.118
|
||||
margin_top = 134.135
|
||||
margin_right = 160.118
|
||||
margin_bottom = 144.135
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "9"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="lives_texture" type="TextureRect" parent="layer"]
|
||||
margin_left = 143.375
|
||||
margin_top = 136.062
|
||||
margin_right = 151.375
|
||||
margin_bottom = 144.062
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="bombs_label" type="Label" parent="layer"]
|
||||
margin_left = 134.904
|
||||
margin_top = 134.33
|
||||
margin_right = 142.904
|
||||
margin_bottom = 144.33
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "9"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="bombs_texture" type="TextureRect" parent="layer"]
|
||||
margin_left = 125.891
|
||||
margin_top = 135.84
|
||||
margin_right = 133.891
|
||||
margin_bottom = 143.84
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="timer_label" type="Label" parent="layer"]
|
||||
margin_left = 100.192
|
||||
margin_top = 133.603
|
||||
margin_right = 127.192
|
||||
margin_bottom = 143.603
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "T: 120"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="round_timer" type="Timer" parent="layer/timer_label"]
|
||||
wait_time = 120.0
|
||||
autostart = true
|
||||
[connection signal="timeout" from="layer/timer_label/round_timer" to="." method="_on_round_timer_timeout"]
|
|
@ -0,0 +1,6 @@
|
|||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://ui/Kenney Mini.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
font_data = ExtResource( 1 )
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://ui/Kenney Mini.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
size = 8
|
||||
font_data = ExtResource( 1 )
|
After Width: | Height: | Size: 114 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/life.png-26a1e835748485449585dc4afd1e5b75.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/life.png"
|
||||
dest_files=[ "res://.import/life.png-26a1e835748485449585dc4afd1e5b75.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 105 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/caret_1.png-520d249e7d3ea2fc39711cc061f5f3ea.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/main_menu/caret_1.png"
|
||||
dest_files=[ "res://.import/caret_1.png-520d249e7d3ea2fc39711cc061f5f3ea.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 105 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/caret_2.png-ca7d4afef12d3df2f27462c44d533ac8.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/main_menu/caret_2.png"
|
||||
dest_files=[ "res://.import/caret_2.png-ca7d4afef12d3df2f27462c44d533ac8.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,102 @@
|
|||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://ui/Kenney Mini.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://ui/background.png" type="Texture" id=2]
|
||||
[ext_resource path="res://ui/kenny_mini_8px.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://objects/spawner/spawner.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://entities/meteorite/meteorite.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://ui/main_menu/menu.gd" type="Script" id=6]
|
||||
[ext_resource path="res://ui/main_menu/caret_1.png" type="Texture" id=7]
|
||||
[ext_resource path="res://ui/main_menu/caret_2.png" type="Texture" id=8]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="AnimatedTexture" id=2]
|
||||
frames = 2
|
||||
frame_0/texture = ExtResource( 7 )
|
||||
frame_1/texture = ExtResource( 8 )
|
||||
frame_1/delay_sec = 0.0
|
||||
|
||||
[node name="main_menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="spawner" parent="." instance=ExtResource( 4 )]
|
||||
position = Vector2( 72, -8 )
|
||||
spawn_type = ExtResource( 5 )
|
||||
maximum_spawns = -1
|
||||
spawn_interval = 0.5
|
||||
|
||||
[node name="layer" type="CanvasLayer" parent="."]
|
||||
layer = 100
|
||||
|
||||
[node name="title" type="Label" parent="layer"]
|
||||
margin_left = 32.0
|
||||
margin_top = 32.0
|
||||
margin_right = 128.0
|
||||
margin_bottom = 52.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Evospace"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="menu" type="Control" parent="layer"]
|
||||
margin_left = 48.0
|
||||
margin_top = 56.0
|
||||
margin_right = 112.0
|
||||
margin_bottom = 112.0
|
||||
script = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="start" type="Label" parent="layer/menu"]
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 18.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Start"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="highscores" type="Label" parent="layer/menu"]
|
||||
margin_left = 8.0
|
||||
margin_top = 24.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 34.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Hiscore"
|
||||
uppercase = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="caret" type="TextureRect" parent="layer/menu"]
|
||||
margin_top = 8.0
|
||||
margin_right = 8.0
|
||||
margin_bottom = 16.0
|
||||
texture = SubResource( 2 )
|
||||
expand = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="background" type="Sprite" parent="."]
|
||||
position = Vector2( 80, 72 )
|
||||
scale = Vector2( 22, 20 )
|
||||
z_index = -100
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
extends Control
|
||||
|
||||
onready var caret = $caret
|
||||
var index = 0
|
||||
var spacing = 16
|
||||
var start_position = 8
|
||||
var menu_items = 0
|
||||
var positions = [ 8, 24 ]
|
||||
|
||||
var highscores_screen = load("ui/hiscores/hiscores.tscn")
|
||||
var game_screen = load("levels/demo.tscn")
|
||||
|
||||
func _ready():
|
||||
menu_items = get_children().size() - 1
|
||||
highscores_screen = highscores_screen.instance()
|
||||
game_screen = game_screen.instance()
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("ui_down"):
|
||||
if index == menu_items - 1:
|
||||
index = 0
|
||||
else:
|
||||
index += 1
|
||||
update_caret()
|
||||
elif Input.is_action_just_pressed("ui_up"):
|
||||
if index == 0:
|
||||
index = menu_items - 1
|
||||
else:
|
||||
index -= 1
|
||||
update_caret()
|
||||
|
||||
if Input.is_action_just_pressed("player_shoot"):
|
||||
var action = str(get_child(index).name)
|
||||
if has_method(action):
|
||||
call(action)
|
||||
Input.action_release("player_shoot")
|
||||
else:
|
||||
print_debug(action, " is not a valid menu action!")
|
||||
|
||||
func update_caret():
|
||||
caret.rect_position.y = start_position + (spacing * index)
|
||||
|
||||
func start():
|
||||
get_node("../../").queue_free()
|
||||
get_tree().get_root().add_child(game_screen)
|
||||
|
||||
func highscores():
|
||||
get_node("../../").queue_free()
|
||||
get_tree().get_root().add_child(highscores_screen)
|
||||
|
||||
func quit():
|
||||
get_tree().quit()
|
|
@ -0,0 +1,53 @@
|
|||
extends Control
|
||||
|
||||
onready var selector = $selector
|
||||
onready var chars = [
|
||||
$first_char,
|
||||
$second_char,
|
||||
$third_char
|
||||
]
|
||||
var index = 0
|
||||
var positions = [ -2, 14, 30 ]
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("ui_right"):
|
||||
if index == chars.size() - 1:
|
||||
index = 0
|
||||
else:
|
||||
index += 1
|
||||
elif Input.is_action_just_pressed("ui_left"):
|
||||
if index == 0:
|
||||
index = chars.size() - 1
|
||||
else:
|
||||
index -= 1
|
||||
selector.rect_position.x = positions[index]
|
||||
|
||||
if Input.is_action_just_pressed("ui_up"):
|
||||
up_ascii()
|
||||
if Input.is_action_just_pressed("ui_down"):
|
||||
down_ascii()
|
||||
|
||||
func up_ascii():
|
||||
var ascii = chars[index].text.to_ascii()
|
||||
var current_ascii = ascii[0]
|
||||
ascii[0] = current_ascii + 1
|
||||
if(ascii[0] > 90):
|
||||
ascii[0] = 65
|
||||
chars[index].text = ascii.get_string_from_ascii()
|
||||
|
||||
func down_ascii():
|
||||
var ascii = chars[index].text.to_ascii()
|
||||
var current_ascii = ascii[0]
|
||||
ascii[0] = current_ascii - 1
|
||||
if(ascii[0] < 65):
|
||||
ascii[0] = 90
|
||||
chars[index].text = ascii.get_string_from_ascii()
|
||||
|
||||
func get_name():
|
||||
var input = PoolStringArray([])
|
||||
for ch in chars:
|
||||
input.append(str(ch.text))
|
||||
return input.join("")
|
|
@ -0,0 +1,63 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://ui/kenny_mini_16px.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://ui/name_selector/selected.png" type="Texture" id=3]
|
||||
[ext_resource path="res://ui/name_selector/selected_2.png" type="Texture" id=4]
|
||||
[ext_resource path="res://ui/name_selector/name_selector.gd" type="Script" id=5]
|
||||
|
||||
[sub_resource type="AnimatedTexture" id=1]
|
||||
frames = 2
|
||||
fps = 2.0
|
||||
frame_0/texture = ExtResource( 3 )
|
||||
frame_1/texture = ExtResource( 4 )
|
||||
frame_1/delay_sec = 0.0
|
||||
|
||||
[node name="name_selector" type="Control"]
|
||||
anchor_right = 0.312
|
||||
anchor_bottom = 0.16
|
||||
margin_right = 0.079998
|
||||
margin_bottom = -0.0400009
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="first_char" type="Label" parent="."]
|
||||
margin_right = 16.0
|
||||
margin_bottom = 20.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "A"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
|
||||
[node name="second_char" type="Label" parent="."]
|
||||
margin_left = 16.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 20.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "A"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
|
||||
[node name="third_char" type="Label" parent="."]
|
||||
margin_left = 32.0
|
||||
margin_right = 48.0
|
||||
margin_bottom = 20.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "A"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
|
||||
[node name="selector" type="TextureRect" parent="."]
|
||||
margin_left = -2.0
|
||||
margin_top = -0.125
|
||||
margin_right = 16.0
|
||||
margin_bottom = 21.875
|
||||
texture = SubResource( 1 )
|
||||
expand = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/selected.png-7e8b81ec794c7a086bdda714fe342740.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/name_selector/selected.png"
|
||||
dest_files=[ "res://.import/selected.png-7e8b81ec794c7a086bdda714fe342740.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 118 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/selected_1.png-e880126c69ab2381ca7ab9e50753e276.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/name_selector/selected_1.png"
|
||||
dest_files=[ "res://.import/selected_1.png-e880126c69ab2381ca7ab9e50753e276.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
After Width: | Height: | Size: 111 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/selected_2.png-1ac340c4d268919bb2bc9ef076176a2b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/name_selector/selected_2.png"
|
||||
dest_files=[ "res://.import/selected_2.png-1ac340c4d268919bb2bc9ef076176a2b.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -0,0 +1,14 @@
|
|||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
bg_color = Color( 0.301961, 0.301961, 0.301961, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
corner_radius_bottom_right = 2
|
||||
corner_radius_bottom_left = 2
|
||||
anti_aliasing = false
|
After Width: | Height: | Size: 99 B |