Ze pew
This commit is contained in:
parent
96581c5f60
commit
39a399f137
@ -1,10 +1,10 @@
|
||||
Timer
|
||||
Sprite2D
|
||||
CollisionShape2D
|
||||
Area2D
|
||||
StaticBody2D
|
||||
RigidBody2D
|
||||
RayCast2D
|
||||
CollisionShape2D
|
||||
Sprite2D
|
||||
AnimatedSprite2D
|
||||
CharacterBody2D
|
||||
CollisionPolygon2D
|
||||
|
@ -16,11 +16,11 @@ dock_5="Inspector,Node,History"
|
||||
|
||||
[EditorNode]
|
||||
|
||||
open_scenes=["res://test_level001.tscn", "res://Enemies/basic_enemy.tscn", "res://Player/player.tscn", "res://Weapons/shotgun.tscn"]
|
||||
open_scenes=["res://Projectiles/sand.tscn"]
|
||||
|
||||
[ScriptEditor]
|
||||
|
||||
open_scripts=["res://Enemies/basic_enemy.gd", "res://Projectiles/basic_projectile.gd", "res://Weapons/basic_weapon.gd", "res://Player/player.gd"]
|
||||
open_scripts=["res://Enemies/basic_enemy.gd", "res://PickableItems/basic_item.gd", "res://Projectiles/basic_projectile.gd", "res://Weapons/basic_weapon.gd", "res://Player/player.gd"]
|
||||
open_help=["Area2D", "CharacterBody2D", "Node2D", "RandomNumberGenerator", "RayCast2D", "RigidBody2D", "StaticBody2D", "Vector2"]
|
||||
script_split_offset=70
|
||||
list_split_offset=0
|
||||
|
@ -1,33 +1,40 @@
|
||||
0b7126e0c6e86d3ec295a72f5aa6e0bd
|
||||
::res://::1673759153
|
||||
README.md::TextFile::-1::1673744149::0::1::::<><>::
|
||||
test_level001.tscn::PackedScene::278447013021769396::1673758831::0::1::::<><>::uid://xev8p1td1icx<>uid://d3y4rna66nylu<>uid://c661br4lh30r8
|
||||
::res://Enemies/::1673758831
|
||||
basic_enemy.gd::GDScript::-1::1673757641::0::1::::<>CharacterBody2D<>::
|
||||
basic_enemy.tscn::PackedScene::7014272596353446583::1673758831::0::1::::<><>::res://Enemies/basic_enemy.gd<>uid://ds4uvvrcxoay1
|
||||
::res://Levels/::1673744149
|
||||
level.tscn::PackedScene::4739050375457527030::1673744149::0::1::::<><>::
|
||||
::res://Music/::1673744196
|
||||
School_Bass.ogg::AudioStreamOggVorbis::8337090337929631753::1673744149::1673744196::1::::<><>::
|
||||
School_BDClave.ogg::AudioStreamOggVorbis::2352609159460477887::1673744149::1673744196::1::::<><>::
|
||||
School_Brass.ogg::AudioStreamOggVorbis::8423202159412100063::1673744149::1673744196::1::::<><>::
|
||||
School_Flute.ogg::AudioStreamOggVorbis::6100788483817358773::1673744149::1673744196::1::::<><>::
|
||||
School_Snare.ogg::AudioStreamOggVorbis::6764331197145035365::1673744149::1673744196::1::::<><>::
|
||||
::res://Player/::1673758831
|
||||
player.gd::GDScript::-1::1673758741::0::1::::<>CharacterBody2D<>::
|
||||
player.tscn::PackedScene::1623935731621421531::1673758831::0::1::::<><>::res://Player/player.gd<>uid://cmtuq84761y0i<>uid://wkeakqjvu3gg
|
||||
::res://Projectiles/::1673757957
|
||||
basic_projectile.gd::GDScript::-1::1673757658::0::1::::<>Area2D<>::
|
||||
basic_projectile.tscn::PackedScene::5856608848916302392::1673757957::0::1::::<><>::res://Projectiles/basic_projectile.gd<>uid://gqotbni355f
|
||||
::res://Sprites/::1673758613
|
||||
placeholder_enemy.png::CompressedTexture2D::8483781162333137450::1673744660::1673744680::1::::<><>::
|
||||
placeholder_player.png::CompressedTexture2D::1565041755936548690::1673744149::1673744500::1::::<><>::
|
||||
placeholder_projectile.png::CompressedTexture2D::13383739614235193::1673744149::1673744515::1::::<><>::
|
||||
placeholder_shotgun.png::CompressedTexture2D::1210666365428533629::1673758421::1673758613::1::::<><>::
|
||||
placeholder_weapon.png::CompressedTexture2D::7577871081029115281::1673744149::1673744508::1::::<><>::
|
||||
::res://TileSets/::1673744149
|
||||
Tiles Set GameJam.png::CompressedTexture2D::9175886574582270754::1673744149::1673744149::1::::<><>::
|
||||
::res://Weapons/::1673759002
|
||||
basic_weapon.gd::GDScript::-1::1673757935::0::1::::<>Node2D<>::
|
||||
basic_weapon.tscn::PackedScene::5655575360493827386::1673757957::0::1::::<><>::res://Weapons/basic_weapon.gd<>uid://df71outtqfcu0<>uid://cpo8qy3y0fuui
|
||||
shotgun.tscn::PackedScene::2587411923144706110::1673759002::0::1::::<><>::uid://cmtuq84761y0i<>uid://ripq64urxouv
|
||||
::res://::1673794835
|
||||
README.md::TextFile::-1::1673712834::0::1::::<><>::
|
||||
test_level001.tscn::PackedScene::278447013021769396::1673794835::0::1::::<><>::uid://xev8p1td1icx<>uid://d3y4rna66nylu<>uid://c661br4lh30r8<>uid://bbg5x0apue0ei<>uid://ca1wv2br88fh8
|
||||
::res://Enemies/::1673794178
|
||||
basic_enemy.gd::GDScript::-1::1673786161::0::1::::<>CharacterBody2D<>::
|
||||
basic_enemy.tscn::PackedScene::7014272596353446583::1673794178::0::1::::<><>::res://Enemies/basic_enemy.gd<>uid://ds4uvvrcxoay1
|
||||
::res://Levels/::1673726687
|
||||
level.tscn::PackedScene::4739050375457527030::1673726687::0::1::::<><>::
|
||||
::res://Music/::1673734693
|
||||
School_Bass.ogg::AudioStreamOggVorbis::8337090337929631753::1673734497::1673734693::1::::<><>::
|
||||
School_BDClave.ogg::AudioStreamOggVorbis::2352609159460477887::1673734497::1673734693::1::::<><>::
|
||||
School_Brass.ogg::AudioStreamOggVorbis::8423202159412100063::1673734497::1673734693::1::::<><>::
|
||||
School_Flute.ogg::AudioStreamOggVorbis::6100788483817358773::1673734497::1673734693::1::::<><>::
|
||||
School_Snare.ogg::AudioStreamOggVorbis::6764331197145035365::1673734497::1673734693::1::::<><>::
|
||||
::res://PickableItems/::1673794737
|
||||
basic_item.gd::GDScript::-1::1673794339::0::1::::<>Area2D<>::
|
||||
basic_item.tscn::PackedScene::5399764951176951635::1673793581::0::1::::<><>::uid://cjrh8t1n0m2e4<>res://PickableItems/basic_item.gd
|
||||
pickable_t_shirt.tscn::PackedScene::2470859690690496564::1673794737::0::1::::<><>::uid://ci6xls3xseci2<>uid://cmtuq84761y0i
|
||||
pickable_shoes.tscn::PackedScene::4827889884997683995::1673794730::0::1::::<><>::uid://ci6xls3xseci2<>uid://bc4mkctxjnugk<>uid://dvwb4dx0p0ypw
|
||||
::res://Player/::1673794835
|
||||
player.gd::GDScript::-1::1673794328::0::1::::<>CharacterBody2D<>::
|
||||
player.tscn::PackedScene::1623935731621421531::1673794835::0::1::::<><>::res://Player/player.gd<>uid://wkeakqjvu3gg
|
||||
::res://Projectiles/::1673786161
|
||||
basic_projectile.gd::GDScript::-1::1673786161::0::1::::<>Area2D<>::
|
||||
basic_projectile.tscn::PackedScene::5856608848916302392::1673786161::0::1::::<><>::res://Projectiles/basic_projectile.gd<>uid://gqotbni355f
|
||||
::res://Sprites/::1673794397
|
||||
placeholder_enemy.png::CompressedTexture2D::8483781162333137450::1673786162::1673786214::1::::<><>::
|
||||
placeholder_player.png::CompressedTexture2D::1565041755936548690::1673786162::1673786214::1::::<><>::
|
||||
placeholder_projectile.png::CompressedTexture2D::13383739614235193::1673786162::1673786214::1::::<><>::
|
||||
placeholder_shotgun.png::CompressedTexture2D::1210666365428533629::1673786162::1673786214::1::::<><>::
|
||||
placeholder_weapon.png::CompressedTexture2D::7577871081029115281::1673786162::1673786214::1::::<><>::
|
||||
shoes.png::CompressedTexture2D::8678756777340800268::1673794389::1673794397::1::::<><>::
|
||||
t_shirt.png::CompressedTexture2D::5440120370828876065::1673791973::1673791980::1::::<><>::
|
||||
::res://TileSets/::1673734812
|
||||
Tiles Set GameJam.png::CompressedTexture2D::9175886574582270754::1673734812::1673734812::1::::<><>::
|
||||
::res://Weapons/::1673794835
|
||||
basic_weapon.gd::GDScript::-1::1673786162::0::1::::<>Node2D<>::
|
||||
basic_weapon.tscn::PackedScene::5655575360493827386::1673786162::0::1::::<><>::res://Weapons/basic_weapon.gd<>uid://df71outtqfcu0<>uid://cpo8qy3y0fuui
|
||||
shotgun.tscn::PackedScene::2587411923144706110::1673794853::0::1::::<><>::uid://cmtuq84761y0i<>uid://dvwb4dx0p0ypw
|
||||
|
@ -1,5 +1,16 @@
|
||||
res://Weapons/shotgun.tscn
|
||||
res://PickableItems/basic_item.tscn
|
||||
res://Player/player.tscn
|
||||
res://Player/player.gd
|
||||
res://PickableItems/basic_item.gd
|
||||
res://test_level001.tscn
|
||||
res://Enemies/basic_enemy.tscn
|
||||
res://Player/player.tscn
|
||||
res://PickableItems/pickable_t_shirt.tscn
|
||||
res://PickableItems/pickable_shoes.tscn
|
||||
res://Weapons/shotgun.tscn
|
||||
res://Weapons/hourglass.tscn
|
||||
res://Weapons/t_shirt_cannon.tscn
|
||||
res://Projectiles/sand.tscn
|
||||
res://Projectiles/basic_projectile.gd
|
||||
res://Projectiles/basic_projectile.tscn
|
||||
res://Enemies/basic_enemy.gd
|
||||
res://Weapons/basic_weapon.gd
|
||||
|
@ -1,6 +1,6 @@
|
||||
[editor_metadata]
|
||||
|
||||
executable_path="/home/medenos/Downloads/Godot_v4.0-beta12_mono_linux_x86_64/Godot_v4.0-beta12_mono_linux.x86_64"
|
||||
executable_path="C:/Godot_v4.0-beta12_mono_win64/Godot_v4.0-beta12_mono_win64/Godot_v4.0-beta12_mono_win64.exe"
|
||||
tile_source_sort=0
|
||||
use_advanced_connections=false
|
||||
|
||||
@ -11,8 +11,8 @@ run_reload_scripts=true
|
||||
|
||||
[recent_files]
|
||||
|
||||
scenes=["res://Weapons/shotgun.tscn", "res://Player/player.tscn", "res://Enemies/basic_enemy.tscn", "res://test_level001.tscn", "res://Weapons/basic_weapon.tscn", "res://Projectiles/basic_projectile.tscn", "res://Enemies/basic_enemie.tscn", "res://player.tscn"]
|
||||
scripts=["Vector2", "StaticBody2D", "RigidBody2D", "RayCast2D", "RandomNumberGenerator", "Node2D", "CharacterBody2D", "Area2D", "res://Weapons/shotgun.gd", "res://Projectiles/basic_projectile.gd"]
|
||||
scenes=["res://Projectiles/sand.tscn", "res://Weapons/hourglass.tscn", "res://Projectiles/basic_projectile.tscn", "res://PickableItems/pickable_t_shirt.tscn", "res://Weapons/t_shirt_cannon.tscn", "res://Weapons/basic_weapon.tscn", "res://Weapons/shotgun.tscn", "res://PickableItems/pickable_shoes.tscn", "res://PickableItems/basic_item.tscn", "res://Player/player.tscn"]
|
||||
scripts=["res://PickableItems/basic_item.gd", "Vector2", "StaticBody2D", "RigidBody2D", "RayCast2D", "RandomNumberGenerator", "Node2D", "CharacterBody2D", "Area2D", "res://Weapons/shotgun.gd"]
|
||||
|
||||
[script_setup]
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
res://Projectiles
|
||||
res://Weapons
|
||||
res://PickableItems
|
||||
res://Enemies
|
||||
res://
|
||||
res://Levels
|
||||
|
@ -3,12 +3,16 @@
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 36,
|
||||
"column": 66,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 40,
|
||||
"scroll_position": 3.0,
|
||||
"selection": false,
|
||||
"row": 69,
|
||||
"scroll_position": 55.0,
|
||||
"selection": true,
|
||||
"selection_from_column": 2,
|
||||
"selection_from_line": 69,
|
||||
"selection_to_column": 66,
|
||||
"selection_to_line": 69,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
|
||||
@ -17,10 +21,10 @@ state={
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 24,
|
||||
"column": 30,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 7,
|
||||
"row": 4,
|
||||
"scroll_position": 0.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
@ -31,11 +35,11 @@ state={
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 130,
|
||||
"column": 123,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 27,
|
||||
"scroll_position": 0.0,
|
||||
"row": 30,
|
||||
"scroll_position": 10.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
@ -45,10 +49,24 @@ state={
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 23,
|
||||
"column": 24,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 2,
|
||||
"row": 3,
|
||||
"scroll_position": 0.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
|
||||
[res://PickableItems/basic_item.gd]
|
||||
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 0,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 12,
|
||||
"scroll_position": 0.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
|
@ -8,7 +8,7 @@ Anim={
|
||||
"grid_snap_active": false,
|
||||
"grid_step": Vector2(8, 8),
|
||||
"grid_visibility": 1,
|
||||
"ofs": Vector2(-835.537, -590.651),
|
||||
"ofs": Vector2(-21.4942, 2.96472),
|
||||
"primary_grid_steps": 8,
|
||||
"show_edit_locks": true,
|
||||
"show_guides": true,
|
||||
@ -32,7 +32,7 @@ Anim={
|
||||
"snap_rotation_step": 0.261799,
|
||||
"snap_scale": false,
|
||||
"snap_scale_step": 0.1,
|
||||
"zoom": 0.629961
|
||||
"zoom": 2.11893
|
||||
}
|
||||
3D={
|
||||
"fov": 70.01,
|
||||
|
Binary file not shown.
@ -3,7 +3,7 @@ extends CharacterBody2D
|
||||
@export var MAX_SPEED = 300.0;
|
||||
@export var ACCELERATION = 1000.0;
|
||||
@export var FRICTION = 1500.0;
|
||||
@export var HP = 20;
|
||||
@export var HP = 100;
|
||||
@export var DAMAGE = 34;
|
||||
@export var COOLDOWN = 2;
|
||||
|
||||
|
12
PickableItems/basic_item.gd
Normal file
12
PickableItems/basic_item.gd
Normal file
@ -0,0 +1,12 @@
|
||||
extends Area2D
|
||||
|
||||
@export var Type : String;
|
||||
@export var Item : PackedScene;
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.name == "Player":
|
||||
pickup_routine(body);
|
||||
|
||||
func pickup_routine(player):
|
||||
player.pickup(self);
|
||||
queue_free();
|
19
PickableItems/basic_item.tscn
Normal file
19
PickableItems/basic_item.tscn
Normal file
@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ci6xls3xseci2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cjrh8t1n0m2e4" path="res://Sprites/t_shirt.png" id="1_mqcsa"]
|
||||
[ext_resource type="Script" path="res://PickableItems/basic_item.gd" id="1_txlye"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0nj5p"]
|
||||
size = Vector2(29, 50)
|
||||
|
||||
[node name="basic_item" type="Area2D"]
|
||||
script = ExtResource("1_txlye")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0.5, 1)
|
||||
shape = SubResource("RectangleShape2D_0nj5p")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_mqcsa")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
16
PickableItems/pickable_shoes.tscn
Normal file
16
PickableItems/pickable_shoes.tscn
Normal file
@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=4 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ci6xls3xseci2" path="res://PickableItems/basic_item.tscn" id="1_c3jw1"]
|
||||
[ext_resource type="PackedScene" uid="uid://bc4mkctxjnugk" path="res://Weapons/hourglass.tscn" id="2_f6mwn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvwb4dx0p0ypw" path="res://Sprites/shoes.png" id="3_bsb8q"]
|
||||
|
||||
[node name="shoes" instance=ExtResource("1_c3jw1")]
|
||||
Type = "weapon"
|
||||
Item = ExtResource("2_f6mwn")
|
||||
|
||||
[node name="CollisionShape2D" parent="." index="0"]
|
||||
position = Vector2(-0.5, -1)
|
||||
|
||||
[node name="Sprite2D" parent="." index="1"]
|
||||
position = Vector2(18, 22)
|
||||
texture = ExtResource("3_bsb8q")
|
11
PickableItems/pickable_t_shirt.tscn
Normal file
11
PickableItems/pickable_t_shirt.tscn
Normal file
@ -0,0 +1,11 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bbg5x0apue0ei"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ci6xls3xseci2" path="res://PickableItems/basic_item.tscn" id="1_a7gul"]
|
||||
[ext_resource type="PackedScene" uid="uid://clusfc1udsrt3" path="res://Weapons/t_shirt_cannon.tscn" id="2_8v7ss"]
|
||||
|
||||
[node name="pickable_t_shirt" instance=ExtResource("1_a7gul")]
|
||||
Type = "weapon"
|
||||
Item = ExtResource("2_8v7ss")
|
||||
|
||||
[node name="CollisionShape2D" parent="." index="0"]
|
||||
position = Vector2(1, 0.5)
|
@ -4,7 +4,6 @@ extends CharacterBody2D
|
||||
@export var ACCELERATION = 2000.0;
|
||||
@export var FRICTION = 3000.0;
|
||||
@export var HP = 100;
|
||||
@export var STARTING_WEAPON : PackedScene;
|
||||
|
||||
@onready var raycast = $RayCast2D;
|
||||
var current_weapon = null;
|
||||
@ -12,10 +11,6 @@ var weapons = [null,null,null];
|
||||
|
||||
func _ready():
|
||||
call_deferred("call_set_player");
|
||||
weapons[0] = STARTING_WEAPON.instantiate();
|
||||
weapons[1] = load("res://Weapons/shotgun.tscn").instantiate();
|
||||
current_weapon = weapons[0];
|
||||
raycast.add_child(current_weapon);
|
||||
|
||||
func _physics_process(delta):
|
||||
var input_vector = get_input_vector();
|
||||
@ -48,6 +43,14 @@ func take_damage(damage):
|
||||
if HP <= 0:
|
||||
kill();
|
||||
|
||||
func pickup(item):
|
||||
if item.Type == "weapon":
|
||||
for n in 3:
|
||||
if !weapons[n]:
|
||||
weapons[n] = item.Item.instantiate();
|
||||
change_weapon(n);
|
||||
return;
|
||||
|
||||
func kill():
|
||||
get_tree().reload_current_scene();
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://xev8p1td1icx"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://xev8p1td1icx"]
|
||||
|
||||
[ext_resource type="Script" path="res://Player/player.gd" id="1_mbyc2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmtuq84761y0i" path="res://Weapons/basic_weapon.tscn" id="2_bo475"]
|
||||
[ext_resource type="Texture2D" uid="uid://wkeakqjvu3gg" path="res://Sprites/placeholder_player.png" id="2_bqbmq"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_mqbrd"]
|
||||
@ -20,7 +19,6 @@ size = Vector2(40, 64)
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
script = ExtResource("1_mbyc2")
|
||||
STARTING_WEAPON = ExtResource("2_bo475")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
frames = SubResource("SpriteFrames_mqbrd")
|
||||
|
@ -2,29 +2,42 @@ extends Area2D
|
||||
|
||||
@export var DAMAGE = 10;
|
||||
@export var SPEED = 700;
|
||||
@export var LIFETIME = 1;
|
||||
|
||||
@onready var life_timer = $LifeTimer;
|
||||
@export var LIFETIME = 1.0;
|
||||
@export var HANG_TIME = 0.0;
|
||||
@export var FRICTION = 0.0;
|
||||
|
||||
var is_hanging = false;
|
||||
var velocity = Vector2.ZERO;
|
||||
var time = 0.0;
|
||||
|
||||
func _process(delta):
|
||||
|
||||
if is_hanging :
|
||||
velocity = velocity * FRICTION;
|
||||
if velocity != Vector2.ZERO:
|
||||
transform.origin += velocity * delta;
|
||||
|
||||
time += delta;
|
||||
|
||||
if time >= LIFETIME:
|
||||
end_of_life();
|
||||
if time >= LIFETIME + HANG_TIME:
|
||||
explode();
|
||||
|
||||
func launch(direction, based_velocity):
|
||||
life_timer.start(LIFETIME);
|
||||
velocity = based_velocity + direction * SPEED;
|
||||
|
||||
func _on_life_timer_timeout():
|
||||
queue_free();
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.name != "Player":
|
||||
if body.is_in_group("enemies"):
|
||||
body.take_damage(DAMAGE);
|
||||
explode();
|
||||
|
||||
func end_of_life():
|
||||
is_hanging = true;
|
||||
|
||||
func explode():
|
||||
#animation and stuff
|
||||
queue_free();
|
||||
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://gqotbni355f" path="res://Sprites/placeholder_projectile.png" id="1_o7jy1"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pp7ve"]
|
||||
size = Vector2(4, 4)
|
||||
|
||||
[node name="basic_projectile" type="Area2D"]
|
||||
script = ExtResource("1_l2kyf")
|
||||
@ -15,7 +16,4 @@ texture = ExtResource("1_o7jy1")
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_pp7ve")
|
||||
|
||||
[node name="LifeTimer" type="Timer" parent="."]
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
[connection signal="timeout" from="LifeTimer" to="." method="_on_life_timer_timeout"]
|
||||
|
13
Projectiles/sand.tscn
Normal file
13
Projectiles/sand.tscn
Normal file
@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bedh0enwukdbf"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cpo8qy3y0fuui" path="res://Projectiles/basic_projectile.tscn" id="1_mqpki"]
|
||||
|
||||
[node name="basic_projectile" instance=ExtResource("1_mqpki")]
|
||||
DAMAGE = 1
|
||||
SPEED = 1000
|
||||
LIFETIME = 0.1
|
||||
HANG_TIME = 0.3
|
||||
FRICTION = 0.92
|
||||
|
||||
[node name="Sprite2D" parent="." index="0"]
|
||||
scale = Vector2(2.43502, 2.43502)
|
BIN
Sprites/shoes.png
Normal file
BIN
Sprites/shoes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 475 B |
34
Sprites/shoes.png.import
Normal file
34
Sprites/shoes.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvwb4dx0p0ypw"
|
||||
path="res://.godot/imported/shoes.png-a3a9ce7f21f0395d79a6dbbc83a97ec6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/shoes.png"
|
||||
dest_files=["res://.godot/imported/shoes.png-a3a9ce7f21f0395d79a6dbbc83a97ec6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
Sprites/t_shirt.png
Normal file
BIN
Sprites/t_shirt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
34
Sprites/t_shirt.png.import
Normal file
34
Sprites/t_shirt.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cjrh8t1n0m2e4"
|
||||
path="res://.godot/imported/t_shirt.png-a7965bd12d86989c09b72326a7679216.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/t_shirt.png"
|
||||
dest_files=["res://.godot/imported/t_shirt.png-a7965bd12d86989c09b72326a7679216.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -25,8 +25,10 @@ func fire(wielder_velocity):
|
||||
get_node("/root").add_child(current_projectile);
|
||||
|
||||
current_projectile.transform = raycast.get_global_transform() ;
|
||||
current_projectile.transform.origin += (get_global_mouse_position() - global_position).normalized() * (rng.randf() * RANGE_MOD);
|
||||
current_projectile.launch((get_global_mouse_position() - global_position).rotated(rng.randf_range(SPREAD,-SPREAD)).normalized(), wielder_velocity);
|
||||
var this_range_mod = rng.randf() * RANGE_MOD;
|
||||
var this_spread_mod = rng.randf_range(SPREAD,-SPREAD);
|
||||
current_projectile.transform.origin += (get_global_mouse_position() - global_position).normalized() * (this_range_mod);
|
||||
current_projectile.launch((get_global_mouse_position() - global_position).rotated(this_spread_mod - this_range_mod / 700).normalized(), wielder_velocity);
|
||||
|
||||
|
||||
func _on_cooldown_timer_timeout():
|
||||
|
21
Weapons/hourglass.tscn
Normal file
21
Weapons/hourglass.tscn
Normal file
@ -0,0 +1,21 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bc4mkctxjnugk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cmtuq84761y0i" path="res://Weapons/basic_weapon.tscn" id="1_yfysf"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvwb4dx0p0ypw" path="res://Sprites/shoes.png" id="2_oyiyx"]
|
||||
[ext_resource type="PackedScene" uid="uid://bedh0enwukdbf" path="res://Projectiles/sand.tscn" id="2_qhdqv"]
|
||||
|
||||
[node name="hourglass" instance=ExtResource("1_yfysf")]
|
||||
position = Vector2(65, -1)
|
||||
PROJECTILE = ExtResource("2_qhdqv")
|
||||
PROJECTILE_AMOUNT = 200
|
||||
COOLDOWN = 1.0
|
||||
SPREAD = 0.5
|
||||
RANGE_MOD = 100
|
||||
|
||||
[node name="Sprite2D" parent="." index="0"]
|
||||
position = Vector2(32, 38)
|
||||
scale = Vector2(1.71875, 1.71875)
|
||||
texture = ExtResource("2_oyiyx")
|
||||
|
||||
[node name="RayCast2D" parent="." index="1"]
|
||||
position = Vector2(-14, 0)
|
@ -1,15 +0,0 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bc4mkctxjnugk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cmtuq84761y0i" path="res://Weapons/basic_weapon.tscn" id="1_0nefe"]
|
||||
[ext_resource type="Texture2D" uid="uid://ripq64urxouv" path="res://Sprites/placeholder_shotgun.png" id="2_r5age"]
|
||||
|
||||
[node name="shotgun" instance=ExtResource("1_0nefe")]
|
||||
PROJECTILE_AMOUNT = 4
|
||||
COOLDOWN = 1.0
|
||||
SPREAD = 0.3
|
||||
RANGE_MOD = 40
|
||||
|
||||
[node name="Sprite2D" parent="." index="0"]
|
||||
position = Vector2(18, 3)
|
||||
scale = Vector2(1.71875, 1.71875)
|
||||
texture = ExtResource("2_r5age")
|
19
Weapons/t_shirt_cannon.tscn
Normal file
19
Weapons/t_shirt_cannon.tscn
Normal file
@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://clusfc1udsrt3"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cmtuq84761y0i" path="res://Weapons/basic_weapon.tscn" id="1_fyfpr"]
|
||||
[ext_resource type="Texture2D" uid="uid://cjrh8t1n0m2e4" path="res://Sprites/t_shirt.png" id="2_xni8e"]
|
||||
|
||||
[node name="t_shirt_cannon" instance=ExtResource("1_fyfpr")]
|
||||
position = Vector2(65, 0)
|
||||
COOLDOWN = 0.8
|
||||
SPREAD = 0.1
|
||||
|
||||
[node name="Sprite2D" parent="." index="0"]
|
||||
position = Vector2(15, 2.38419e-07)
|
||||
rotation = 1.64532
|
||||
scale = Vector2(0.929632, 0.929632)
|
||||
texture = ExtResource("2_xni8e")
|
||||
|
||||
[node name="RayCast2D" parent="." index="1"]
|
||||
position = Vector2(2, 0)
|
||||
target_position = Vector2(29, 0)
|
@ -1,8 +1,10 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d748m0x7o1nc"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://d748m0x7o1nc"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://xev8p1td1icx" path="res://Player/player.tscn" id="1_51g8b"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3y4rna66nylu" path="res://TileSets/Tiles Set GameJam.png" id="2_xwre6"]
|
||||
[ext_resource type="PackedScene" uid="uid://c661br4lh30r8" path="res://Enemies/basic_enemy.tscn" id="3_e1d3p"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbg5x0apue0ei" path="res://PickableItems/pickable_t_shirt.tscn" id="4_5egyc"]
|
||||
[ext_resource type="PackedScene" path="res://PickableItems/pickable_shoes.tscn" id="5_4b36u"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_aemot"]
|
||||
resource_name = "Test"
|
||||
@ -158,3 +160,9 @@ position = Vector2(948, 660)
|
||||
|
||||
[node name="BasicEnemy7" parent="." instance=ExtResource("3_e1d3p")]
|
||||
position = Vector2(1322, 618)
|
||||
|
||||
[node name="pickable_t_shirt" parent="." instance=ExtResource("4_5egyc")]
|
||||
position = Vector2(172, 127)
|
||||
|
||||
[node name="shoes" parent="." instance=ExtResource("5_4b36u")]
|
||||
position = Vector2(51, 155)
|
||||
|
Loading…
Reference in New Issue
Block a user