add the things.

This commit is contained in:
Robin Hübner 2017-08-04 20:53:05 +02:00
parent 3d46eab5c3
commit 3524712b6f
20 changed files with 34 additions and 20 deletions

View File

@ -1,18 +1,19 @@
[gd_scene load_steps=4 format=1] [gd_scene load_steps=4 format=1]
[ext_resource path="res://Asteroid.gd" type="Script" id=1] [ext_resource path="res://Asteroid.gd" type="Script" id=1]
[ext_resource path="res://raw/asteroid.png" type="Texture" id=2] [ext_resource path="res://raw/asteroid_small.png" type="Texture" id=2]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
custom_solver_bias = 0.0 custom_solver_bias = 0.0
extents = Vector2( 25.1672, 26.3172 ) extents = Vector2( 12.234, 13.1952 )
[node name="Asteroid" type="KinematicBody2D"] [node name="Asteroid" type="KinematicBody2D"]
transform/scale = Vector2( 2, 2 )
input/pickable = false input/pickable = false
shapes/0/shape = SubResource( 1 ) shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, -0.17482, 3.67132 ) shapes/0/transform = Matrix32( 1, 0, 0, 1, -0.17482, 1.87222 )
shapes/0/trigger = false shapes/0/trigger = false
collision/layers = 1 collision/layers = 1
collision/mask = 1 collision/mask = 1
@ -25,7 +26,7 @@ texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( -0.17482, 3.67132 ) transform/pos = Vector2( -0.17482, 1.87222 )
shape = SubResource( 1 ) shape = SubResource( 1 )
trigger = false trigger = false
_update_shape_index = 0 _update_shape_index = 0

View File

@ -10,6 +10,7 @@ extents = Vector2( 0.99762, 3.98857 )
[node name="Bullet" type="KinematicBody2D"] [node name="Bullet" type="KinematicBody2D"]
transform/rot = 180.0
input/pickable = false input/pickable = false
shapes/0/shape = SubResource( 1 ) shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 ) shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )

View File

@ -69,5 +69,6 @@ region_rect = Rect2( 0, 0, 8192, 8192 )
[node name="EnemyGrunt" parent="." instance=ExtResource( 7 )] [node name="EnemyGrunt" parent="." instance=ExtResource( 7 )]
transform/pos = Vector2( 127.878, -20.3627 ) transform/pos = Vector2( 127.878, -20.3627 )
transform/scale = Vector2( 1.5, 1.5 )

4
Gun.gd
View File

@ -4,6 +4,7 @@ var Bullet = load("res://Bullet.tscn")
var gun_cooldown = 0 var gun_cooldown = 0
var gun_delay = 0.1125 var gun_delay = 0.1125
var gun_spread_max = deg2rad(1) # degrees max
func _ready(): func _ready():
set_fixed_process(true) set_fixed_process(true)
@ -17,5 +18,6 @@ func fire(delta, vel, dir):
var gun_pos = get_global_pos() var gun_pos = get_global_pos()
new_bullet.set_pos(gun_pos + vel) new_bullet.set_pos(gun_pos + vel)
get_tree().get_root().add_child(new_bullet) get_tree().get_root().add_child(new_bullet)
new_bullet.fire(delta, vel, dir, 512) var rot = rand_range(-gun_spread_max, gun_spread_max)
new_bullet.fire(delta, vel, dir.rotated(rot), 512)
gun_cooldown += gun_delay gun_cooldown += gun_delay

BIN
raw/asteroid.ase (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
raw/asteroid_medium.ase (Stored with Git LFS) Normal file

Binary file not shown.

BIN
raw/asteroid_medium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,2 @@
filter=false
gen_mipmaps=false

BIN
raw/asteroid_small.ase (Stored with Git LFS) Normal file

Binary file not shown.

BIN
raw/asteroid_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

View File

@ -0,0 +1,2 @@
filter=false
gen_mipmaps=false

BIN
raw/enemy_grunt.ase (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 272 B

View File

@ -1,3 +1,2 @@
filter=false filter=false
gen_mipmaps=false gen_mipmaps=false
anisotropic=true

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8f3e61a8c2412de50a0148ec89a179462304b044ff39ee77a2dd70cdb4eb8a9f oid sha256:a4ee2a229e536843a7614db4df999ffb22a4dd382176d4dd24a333870dcd8304
size 990 size 1047

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 820 B

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:e527fef8ec783c4d0fe4da31c38011107940600b9db3df77621c815f35166e0a oid sha256:4d43c431b9848d37f00b63f37a5f0a4a72b482591f925ffe609a723f6fe06ad5
size 578 size 552

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 110 B