From b3caf26e0d00b6a2532d7b312dba9851c5b26836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCbner?= Date: Mon, 31 Jul 2017 16:49:04 +0200 Subject: [PATCH] rocks --- Asteroid.gd | 3 ++- Asteroid.tscn | 7 ++++++- Game.tscn | 19 +++++++++++++++++-- Gun.gd | 2 +- Player.tscn | 4 ++-- raw/asteroid.ase | 3 +++ raw/asteroid.png | Bin 0 -> 783 bytes raw/asteroid.png.flags | 1 + 8 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 raw/asteroid.ase create mode 100644 raw/asteroid.png create mode 100644 raw/asteroid.png.flags diff --git a/Asteroid.gd b/Asteroid.gd index 2135355..965c33e 100644 --- a/Asteroid.gd +++ b/Asteroid.gd @@ -40,4 +40,5 @@ func _fixed_process(delta): self.rotate(rot_vel) func _draw(): - draw_rect(rect, Color(1, 1, 1)) \ No newline at end of file + pass + #draw_rect(rect, Color(1, 1, 1)) \ No newline at end of file diff --git a/Asteroid.tscn b/Asteroid.tscn index 6696b14..48f8ffe 100644 --- a/Asteroid.tscn +++ b/Asteroid.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=1] +[gd_scene load_steps=3 format=1] [ext_resource path="res://Asteroid.gd" type="Script" id=1] +[ext_resource path="res://raw/asteroid.png" type="Texture" id=2] [node name="Asteroid" type="KinematicBody2D"] @@ -10,4 +11,8 @@ collision/mask = 1 collision/margin = 0.08 script/script = ExtResource( 1 ) +[node name="Sprite" type="Sprite" parent="."] + +texture = ExtResource( 2 ) + diff --git a/Game.tscn b/Game.tscn index 2a299a2..75b612a 100644 --- a/Game.tscn +++ b/Game.tscn @@ -35,10 +35,25 @@ scroll/limit_begin = Vector2( 0, 0 ) scroll/limit_end = Vector2( 0, 0 ) scroll/ignore_camera_zoom = true +[node name="ParallaxLayer 2" type="ParallaxLayer" parent="ParallaxBackground"] + +transform/rot = 90.0 +motion/scale = Vector2( 0.5, 0.5 ) +motion/offset = Vector2( 0, 0 ) +motion/mirroring = Vector2( 0, 0 ) + +[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer 2"] + +texture = ExtResource( 5 ) +region = true +region_rect = Rect2( 0, 0, 8192, 8192 ) + [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] -motion/scale = Vector2( 0.25, 0.25 ) -motion/offset = Vector2( 0, 0 ) +visibility/opacity = 0.5 +visibility/self_opacity = 0.5 +motion/scale = Vector2( 0.45, 0.45 ) +motion/offset = Vector2( 128, 128 ) motion/mirroring = Vector2( 0, 0 ) [node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] diff --git a/Gun.gd b/Gun.gd index 6bd0200..b7825f8 100644 --- a/Gun.gd +++ b/Gun.gd @@ -15,7 +15,7 @@ func fire(delta, vel, dir): if gun_cooldown <= 0: var new_bullet = Bullet.instance() var gun_pos = get_global_pos() - new_bullet.set_pos(gun_pos) + new_bullet.set_pos(gun_pos + vel) get_tree().get_root().add_child(new_bullet) new_bullet.fire(delta, vel, dir, 512) gun_cooldown += gun_delay diff --git a/Player.tscn b/Player.tscn index 1833365..4f6321d 100644 --- a/Player.tscn +++ b/Player.tscn @@ -21,12 +21,12 @@ texture = ExtResource( 2 ) [node name="LeftGun" type="Sprite" parent="Sprite"] -transform/pos = Vector2( -13.0319, -4.86733 ) +transform/pos = Vector2( -12.5228, -4.92389 ) script/script = ExtResource( 3 ) [node name="RightGun" type="Sprite" parent="Sprite"] -transform/pos = Vector2( 12.0375, -4.97201 ) +transform/pos = Vector2( 12.4714, -4.99753 ) script/script = ExtResource( 3 ) [node name="Engine" type="Particles2D" parent="Sprite"] diff --git a/raw/asteroid.ase b/raw/asteroid.ase new file mode 100644 index 0000000..a686edb --- /dev/null +++ b/raw/asteroid.ase @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b29034b94d6c4daf9e8b33e12b0a7b0640ec0dc6e3938974a1cc03d00c460445 +size 1303 diff --git a/raw/asteroid.png b/raw/asteroid.png new file mode 100644 index 0000000000000000000000000000000000000000..fd99ab1bbf41c46349e805718f4763333e002231 GIT binary patch literal 783 zcmV+q1MvKbP)g^oR4U{`>3WNp#M^1*n?<9#Q{eHY7+h)(u1fs$Y+m}kS(PVk zO2PzA9;4zkA^=YQVzDUw|N8R2Ge#G}C4x%6)7uq6#c{cbinjnach|-F=eN(|*d&4i zyTXJic|2Z11onWcV5F2gUJZI+6}wpgRQD3(jhEQg;HTtM3CA zi{c(7!e+IGR=ZnrLVq~lQk=kY099Gt1uiDjk+)Miy)JZm-C9nl?Eoq&Ic`00iBc7h z>jZMKa1}p{UJOG~wcK)wBFO=qqN13M2V@aUw+vJwEPJ!@pjPsxI0{>_6k7(R*Zi0e-wCD$ zNr21qtI+fC!e=986+pWG79&aC0=88^e@LS2Uy>BSg{zySbC3e)xLiOMAofCtp}N2+ zKx~Cj`XTEeZvk6B5yKK7*4qF-5mK72iliK1vcGTRH7Nlww&bag#3TV?D})?eb5F(r z)auW<{{a#bfC4vpfIW1DC7@jWs@G*Mk`Tbe!~NsVxjL`Nk`MrQnDykVt~j-Dv)baZ zwZ