From 669324f5c29a5c26769aee0165f02083612e2012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCbner?= Date: Sun, 30 Jul 2017 20:46:44 +0200 Subject: [PATCH] shitty power station thing --- Bullet.gd | 7 +++++++ Bullet.tscn | 13 +++++++++++++ EnemyGrunt.tscn | 10 ++++++++++ Player.gd | 10 ++++++++++ PowerStation.gd | 16 ++++++++++++++++ PowerStation.tscn | 19 +++++++++++++++++++ engine.cfg | 2 ++ raw/power_station.ase | 3 +++ raw/power_station.png | Bin 0 -> 1272 bytes raw/power_station.png.flags | 1 + 10 files changed, 81 insertions(+) create mode 100644 Bullet.gd create mode 100644 Bullet.tscn create mode 100644 EnemyGrunt.tscn create mode 100644 PowerStation.gd create mode 100644 PowerStation.tscn create mode 100644 raw/power_station.ase create mode 100644 raw/power_station.png create mode 100644 raw/power_station.png.flags diff --git a/Bullet.gd b/Bullet.gd new file mode 100644 index 0000000..5f7b88d --- /dev/null +++ b/Bullet.gd @@ -0,0 +1,7 @@ +extends KinematicBody2D + +func _ready(): + set_fixed_process(true) + +func _fixed_process(delta): + pass diff --git a/Bullet.tscn b/Bullet.tscn new file mode 100644 index 0000000..0c2a497 --- /dev/null +++ b/Bullet.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=1] + +[ext_resource path="res://Bullet.gd" type="Script" id=1] + +[node name="Bullet" type="KinematicBody2D"] + +input/pickable = false +collision/layers = 1 +collision/mask = 1 +collision/margin = 0.08 +script/script = ExtResource( 1 ) + + diff --git a/EnemyGrunt.tscn b/EnemyGrunt.tscn new file mode 100644 index 0000000..8c359af --- /dev/null +++ b/EnemyGrunt.tscn @@ -0,0 +1,10 @@ +[gd_scene format=1] + +[node name="EnemyGrunt" type="KinematicBody2D"] + +input/pickable = false +collision/layers = 1 +collision/mask = 1 +collision/margin = 0.08 + + diff --git a/Player.gd b/Player.gd index b3c6515..e062ea9 100644 --- a/Player.gd +++ b/Player.gd @@ -34,6 +34,16 @@ func _fixed_process(delta): mov_delta += -ship_dir elif Input.is_action_pressed("player_move_backwards"): mov_delta += ship_dir + + if Input.is_action_pressed("player_attack_primary"): + pass + elif Input.is_action_pressed("player_attack_secondary"): + pass + + if Input.is_action_pressed("player_switch_up"): + pass + elif Input.is_action_pressed("player_switch_down"): + pass sprite.set_rot(ship_dir.angle()) diff --git a/PowerStation.gd b/PowerStation.gd new file mode 100644 index 0000000..19ae36d --- /dev/null +++ b/PowerStation.gd @@ -0,0 +1,16 @@ +extends KinematicBody2D + +var rotation_speed = deg2rad(11.25) # degrees per second + +func _ready(): + var t = get_tree() + var r = t.get_root() + var n = r.get_node("Game/MinimapControl") + n.register_entity(self) + set_process(true) + +func type(): + return "PowerStation" + +func _process(delta): + self.rotate(rotation_speed * delta) \ No newline at end of file diff --git a/PowerStation.tscn b/PowerStation.tscn new file mode 100644 index 0000000..3f9af69 --- /dev/null +++ b/PowerStation.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=3 format=1] + +[ext_resource path="res://PowerStation.gd" type="Script" id=1] +[ext_resource path="res://raw/power_station.png" type="Texture" id=2] + +[node name="PowerStation" type="KinematicBody2D"] + +input/pickable = false +collision/layers = 1 +collision/mask = 1 +collision/margin = 0.08 +script/script = ExtResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] + +transform/scale = Vector2( 2, 2 ) +texture = ExtResource( 2 ) + + diff --git a/engine.cfg b/engine.cfg index 20561b9..f953ea4 100644 --- a/engine.cfg +++ b/engine.cfg @@ -7,6 +7,8 @@ icon="res://icon.png" [input] player_attack_secondary=[mbutton(0, 2)] +player_switch_up=[mbutton(0, 4)] +player_switch_down=[mbutton(0, 5)] player_move_forwards=[key(Up), key(W), jaxis(0, 2)] player_move_backwards=[key(S), key(Down), jaxis(0, 3)] player_attack_primary=[mbutton(0, 1)] diff --git a/raw/power_station.ase b/raw/power_station.ase new file mode 100644 index 0000000..53041e0 --- /dev/null +++ b/raw/power_station.ase @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec423b64d26fc631e98da5910e9f22e0e758e12836a3e6409fac3d76ecc1f6ae +size 1188 diff --git a/raw/power_station.png b/raw/power_station.png new file mode 100644 index 0000000000000000000000000000000000000000..f01d44ec6ae8a9652d8fec0346415d30e32eaa0e GIT binary patch literal 1272 zcmV zkyIvNf;UX%XuNB zZYiXaB44T2yycdQge*fr&_)^}f>;19c@xuiAI;}GtVTm`x$@=Bx-1u(En*RhlER_n zSEHeb5JxBzm1+&;FUL5l)Kf`4wg92z6(oeD#~_>p*%yZ1UyHo1kYB zNIbzSz&8H*X}fPFs)AoEa7A#w0+OL_+wk?_vybySSOt)d^CxwCx!GiFy+3XD(Y(A_ z2RrKDZ(Ovj_h07;nI}*pd=emp{L|yDRo&CGmec)|2eR1CJLZ}GEU6OA; z-)&rHMTiJwD!eVXSH#tIEId8l7PzAWz?=-lB<~{|O9i%J!_@Dp@JGpIODB!xYNsX z+V|N;Jtqaof}EGdgW4{cH*|0^DjT+GuoN~9x_xT_bfrUAd3^PyZR$peL-9gT|?Uhc2GbBY*>Th^}t&k)LQDtY7F&aHMMX-_g*(R~i)rNBz z)ZNaexVo>(aout@8RNY7@aevbyw5h}%0Bxj+gP(f)u8KI|FzXMVR`~Z-sSQ>n@sy$ zU~i7vf~0ShpgPuHgO~ej;Jg3d_w}<}B*8(PoeA1H+9!nCM|yxwRlSo?G0uAro38-V z4%ai6eH5GmQ0|mvY&M6(m-}lpdhU%BTiX)*e6OlC53qGafg1!}xqwdu=B9_(K7hys zrKvFWuTY7QON1=mW*ZTlnPAq9PIFu~+nY_sWVE-%0!iXS*=M##W`ZG|P!o_?ZF1oY zl4J~^o^dxfI6|m0p-1JU$ZcOBk8^?{$aQCkLo847z>f9?ZLdPi9bySs0=&+X^?{^AK&LxM zU+28xnG`@JG%-cchd=et$J!WGMC{ zaLEJAxj-yW;GF!*dOA!(9uRDf9)c%G$pgaaa28J}Yu^a@uo?}6ydZ=;00iap`}Xm4 iD0v`I0O0@meEu&WKL9SjV|H@@0000