Browse Source

Add new sfx, cards drops, levels

master
Jens Pitkänen 3 years ago
parent
commit
89f74f6d39
33 changed files with 1097 additions and 255 deletions
  1. +2
    -2
      assets/environment/main_env.tres
  2. BIN
      assets/model/ArenaFloor.mesh
  3. BIN
      assets/model/ArenaFloor.vox
  4. +1
    -1
      assets/model/ArenaFloor.vox.import
  5. BIN
      assets/model/ArenaWall.mesh
  6. BIN
      assets/model/ArenaWall.vox
  7. +1
    -1
      assets/model/ArenaWall.vox.import
  8. BIN
      assets/model/Heart.mesh
  9. BIN
      assets/model/Heart.vox
  10. +16
    -0
      assets/model/Heart.vox.import
  11. +474
    -46
      assets/scenes/arena/Arena.tscn
  12. +40
    -15
      assets/scenes/arena/ArenaInterior.tscn
  13. +1
    -1
      assets/scenes/arena/ArenaWall.tscn
  14. +21
    -0
      assets/scenes/arena/Finish.gd
  15. +41
    -0
      assets/scenes/arena/RandomCard.gd
  16. +34
    -0
      assets/scenes/arena/RandomCard.tscn
  17. +34
    -0
      assets/scenes/arena/Spawner.gd
  18. +47
    -0
      assets/scenes/arena/Spawner.tscn
  19. +0
    -1
      assets/scenes/cards/CardBase.gd
  20. +3
    -37
      assets/scenes/cards/CardBody.tscn
  21. +1
    -1
      assets/scenes/cards/CardFire.tscn
  22. +6
    -6
      assets/scenes/cards/CardIce.tscn
  23. +5
    -5
      assets/scenes/cards/CardShock.tscn
  24. +7
    -3
      assets/scenes/enemies/BaseEnemy.gd
  25. +274
    -116
      assets/scenes/enemies/EnemyBody.tscn
  26. +10
    -6
      assets/scenes/player/Deck.gd
  27. +27
    -13
      assets/scenes/player/Deck.tscn
  28. +3
    -0
      assets/scenes/player/Player.gd
  29. BIN
      assets/sfx/card_retrieve.wav
  30. +24
    -0
      assets/sfx/card_retrieve.wav.import
  31. BIN
      assets/sfx/shing.wav
  32. +24
    -0
      assets/sfx/shing.wav.import
  33. +1
    -1
      project.godot

+ 2
- 2
assets/environment/main_env.tres View File

@ -89,8 +89,8 @@ glow_levels/5 = true
glow_levels/6 = false
glow_levels/7 = false
glow_intensity = 0.8
glow_strength = 0.95
glow_bloom = 0.05
glow_strength = 0.9
glow_bloom = 0.03
glow_blend_mode = 1
glow_hdr_threshold = 1.0
glow_hdr_scale = 1.5


BIN
assets/model/ArenaFloor.mesh View File


BIN
assets/model/ArenaFloor.vox View File


+ 1
- 1
assets/model/ArenaFloor.vox.import View File

@ -7,7 +7,7 @@ path="res://.import/ArenaFloor.vox-3c82af8cadebfb909db037f1d6c96a4e.mesh"
[deps]
source_file="res://assets/model/ArenaFloor.vox"
source_md5="a83e792a64e2f32e95790f13a946726c"
source_md5="7eece17da4d7417d3975e610687b68f0"
dest_files=[ "res://.import/ArenaFloor.vox-3c82af8cadebfb909db037f1d6c96a4e.mesh" ]
dest_md5="d41d8cd98f00b204e9800998ecf8427e"


BIN
assets/model/ArenaWall.mesh View File


BIN
assets/model/ArenaWall.vox View File


+ 1
- 1
assets/model/ArenaWall.vox.import View File

@ -7,7 +7,7 @@ path="res://.import/ArenaWall.vox-0e42247c36e83a00b8e44433c780830a.mesh"
[deps]
source_file="res://assets/model/ArenaWall.vox"
source_md5="7218a8fe5f07d77ca991cd344e7bea8c"
source_md5="bbfbb0e6c4e2c37f652a15d8d9b23b3f"
dest_files=[ "res://.import/ArenaWall.vox-0e42247c36e83a00b8e44433c780830a.mesh" ]
dest_md5="d41d8cd98f00b204e9800998ecf8427e"


BIN
assets/model/Heart.mesh View File


BIN
assets/model/Heart.vox View File


+ 16
- 0
assets/model/Heart.vox.import View File

@ -0,0 +1,16 @@
[remap]
importer="MagicaVoxel-Importer"
type="Mesh"
path="res://.import/Heart.vox-a4198145861bd6e7fc1c7328e4af8077.mesh"
[deps]
source_file="res://assets/model/Heart.vox"
source_md5="0e14a97ff03a6765662492a08c23cc5f"
dest_files=[ "res://.import/Heart.vox-a4198145861bd6e7fc1c7328e4af8077.mesh" ]
dest_md5="d41d8cd98f00b204e9800998ecf8427e"
[params]

+ 474
- 46
assets/scenes/arena/Arena.tscn View File

@ -1,68 +1,496 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://assets/scenes/arena/ArenaInterior.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/scenes/cards/CardIce.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/scenes/player/Player.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/scenes/enemies/ImpEnemy.tscn" type="PackedScene" id=4]
[ext_resource path="res://assets/scenes/enemies/GreaterImp.tscn" type="PackedScene" id=5]
[sub_resource type="GDScript" id=1]
script/source = "# FREEZE CARD #
extends \"res://assets/scenes/cards/CardBase.gd\"
const DAMAGE = 2
const BONUS_DAMAGE = 3
const FREEZE_TIME = 1.5
func hit(enemy):
if enemy.has_method(\"freeze\"):
if enemy.frozen():
ice_explosion = true
enemy.take_damage(BONUS_DAMAGE)
enemy.unfreeze()
else:
enemy.freeze(FREEZE_TIME)
if enemy.has_method(\"take_damage\"):
enemy.take_damage(DAMAGE)
return true
return false
"
[gd_scene load_steps=15 format=2]
[ext_resource path="res://assets/scenes/player/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/scenes/arena/Spawner.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/scenes/arena/ArenaInterior.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/scenes/arena/RandomCard.tscn" type="PackedScene" id=4]
[ext_resource path="res://assets/scenes/enemies/ImpEnemy.tscn" type="PackedScene" id=5]
[ext_resource path="res://assets/scenes/enemies/GreaterImp.tscn" type="PackedScene" id=6]
[ext_resource path="res://assets/scenes/arena/Finish.gd" type="Script" id=7]
[ext_resource path="res://assets/scenes/arena/ArenaWall.tscn" type="PackedScene" id=8]
[ext_resource path="res://assets/model/ArenaWall.mesh" type="ArrayMesh" id=9]
[ext_resource path="res://assets/material/WoodMaterial.tres" type="Material" id=10]
[ext_resource path="res://assets/font/Eligible-Regular.ttf" type="DynamicFontData" id=11]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 6, 1, 6 )
[sub_resource type="DynamicFont" id=2]
size = 96
use_mipmaps = false
use_filter = false
font_data = ExtResource( 11 )
_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ]
[sub_resource type="DynamicFont" id=3]
size = 72
use_mipmaps = false
use_filter = false
font_data = ExtResource( 11 )
_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ]
[node name="Arena" type="Spatial"]
_sections_unfolded = [ "Transform" ]
[node name="Room" parent="." index="0" instance=ExtResource( 1 )]
[node name="Player" parent="." index="0" instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 5 )
_sections_unfolded = [ "Transform" ]
[node name="Room01" parent="." index="1" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1 )
[node name="RoomInterior" parent="Room01" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room01" index="2"]
[node name="RandomCard" parent="Room01" index="3" instance=ExtResource( 4 )]
[node name="Room02" parent="." index="2" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -15 )
[node name="RoomInterior" parent="Room02" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room02" index="2"]
[node name="ImpEnemy" parent="Room02/Enemies" index="0" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.26265, 0.000172973, 1.25753 )
[node name="Room05" parent="." index="3" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -29 )
[node name="RoomInterior" parent="Room05" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room05" index="2"]
[node name="ImpEnemy" parent="Room05/Enemies" index="0" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.26265, 0.000172973, 1.25753 )
[node name="ImpEnemy2" parent="Room05/Enemies" index="1" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.26265, 0.000172973, -2.74247 )
[node name="ImpEnemy3" parent="Room05/Enemies" index="2" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.73735, 0.000172973, -2.74247 )
[node name="ImpEnemy4" parent="Room05/Enemies" index="3" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.26265, 0.000172973, -2.74247 )
[node name="Room04" parent="." index="4" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -43 )
[node name="RoomInterior" parent="Room04" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room04" index="2"]
[node name="ImpEnemy" parent="Room04/Enemies" index="0" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.26265, 0.000172973, 1.25753 )
[node name="ImpEnemy2" parent="Room04/Enemies" index="1" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.73735, 0.000172973, 5.25753 )
[node name="ImpEnemy3" parent="Room04/Enemies" index="2" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.1657, 0.00017488, 5.22511 )
[node name="GreaterImpEnemy12" parent="Room04/Enemies" index="3" instance=ExtResource( 6 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, -2.84696 )
[node name="Room03" parent="." index="5" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, -43 )
[node name="RoomInterior" parent="Room03" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room03" index="2"]
[node name="ImpEnemy" parent="Room03/Enemies" index="0" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.26265, 0.000172973, -2.74247 )
[node name="ImpEnemy2" parent="Room03/Enemies" index="1" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.26265, 0.000172973, 5.25753 )
[node name="ImpEnemy3" parent="Room03/Enemies" index="2" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 3.73735, 0.000172973, 5.25753 )
[node name="ImpEnemy4" parent="Room03/Enemies" index="3" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 3.73735, 0.000172973, -2.74247 )
[node name="GreaterImpEnemy11" parent="Room03/Enemies" index="4" instance=ExtResource( 6 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 1.15304 )
[node name="Room08" parent="." index="6" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 28, 0, -43 )
[node name="RoomInterior" parent="Room08" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room08" index="2"]
[node name="ImpEnemy" parent="Room08/Enemies" index="0" instance=ExtResource( 5 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, -0.26265, 0.000172973, 1.25753 )
_sections_unfolded = [ "Transform" ]
[node name="ImpEnemy2" parent="Room08/Enemies" index="1" instance=ExtResource( 5 )]
[node name="Room2" parent="." index="1" instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, -4.26265, 0.000172973, -2.74247 )
_sections_unfolded = [ "Transform" ]
[node name="ImpEnemy3" parent="Room08/Enemies" index="2" instance=ExtResource( 5 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, -4.26265, 0.000172973, 5.25753 )
_sections_unfolded = [ "Transform" ]
[node name="GreaterImpEnemy9" parent="Room08/Enemies" index="3" instance=ExtResource( 6 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4, 0, -2.84696 )
[node name="GreaterImpEnemy10" parent="Room08/Enemies" index="4" instance=ExtResource( 6 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4, 0, 5.15305 )
[node name="Room09" parent="." index="7" instance=ExtResource( 2 )]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 28, 0, -29 )
[node name="RoomInterior" parent="Room09" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room09" index="2"]
[node name="GreaterImpEnemy" parent="Room09/Enemies" index="0" instance=ExtResource( 6 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, -0.00273705, 0, 1.07552 )
[node name="GreaterImpEnemy3" parent="Room09/Enemies" index="1" instance=ExtResource( 6 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, -4, 0, -2.84696 )
[node name="GreaterImpEnemy5" parent="Room09/Enemies" index="2" instance=ExtResource( 6 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 14 )
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, -4, 0, 5.15305 )
[node name="CardIce" parent="Room2" index="12" instance=ExtResource( 2 )]
[node name="GreaterImpEnemy4" parent="Room09/Enemies" index="3" instance=ExtResource( 6 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.70285, 0.163505, -16.0466 )
script = SubResource( 1 )
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4, 0, -2.84696 )
[node name="Player" parent="." index="2" instance=ExtResource( 3 )]
[node name="GreaterImpEnemy6" parent="Room09/Enemies" index="4" instance=ExtResource( 6 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3 )
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4, 0, 5.15305 )
[node name="Room10" type="Spatial" parent="." index="8"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 28, 0, -15 )
script = ExtResource( 7 )
_sections_unfolded = [ "Transform" ]
[node name="Area" type="Area" parent="Room10" index="0"]
input_ray_pickable = false
input_capture_on_drag = false
space_override = 0
gravity_point = false
gravity_distance_scale = 0.0
gravity_vec = Vector3( 0, -1, 0 )
gravity = 9.8
linear_damp = 0.1
angular_damp = 1.0
priority = 0.0
monitoring = true
monitorable = true
collision_layer = 1
collision_mask = 1
audio_bus_override = false
audio_bus_name = "Master"
reverb_bus_enable = false
reverb_bus_name = "Master"
reverb_bus_amount = 0.0
reverb_bus_uniformity = 0.0
_sections_unfolded = [ "Transform" ]
[node name="ImpEnemy" parent="." index="3" instance=ExtResource( 4 )]
[node name="CollisionShape" type="CollisionShape" parent="Room10/Area" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.756626, 1 )
shape = SubResource( 1 )
disabled = false
_sections_unfolded = [ "Transform" ]
[node name="RoomInterior" parent="Room10" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 )
[node name="Enemies" type="Spatial" parent="Room10" index="2"]
[node name="Misc" type="Spatial" parent="." index="9"]
editor/display_folded = true
[node name="Wall" type="MeshInstance" parent="Misc" index="0" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, -0.3, 0, 0.3, 0, 0.3, 0, -1.31134e-08, 7.20705, 0.0805511, 0.272517 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 9 )
skeleton = NodePath("..")
material/0 = ExtResource( 10 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Wall5" parent="Misc" index="1" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, -0.3, 0, 0.3, 0, 0.3, 0, -1.31134e-08, 7.20705, 0.0805511, -14.7275 )
[node name="Wall6" parent="Misc" index="2" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, -0.3, 0, 0.3, 0, 0.3, 0, -1.31134e-08, 7.20705, 0.0805511, -27.7275 )
[node name="Wall8" parent="Misc" index="3" instance=ExtResource( 8 )]
transform = Transform( -0.3, 0, 2.62268e-08, 0, 0.3, 0, -2.62268e-08, 0, -0.3, 14.0682, 0.0805511, -34.5886 )
[node name="Wall11" parent="Misc" index="4" instance=ExtResource( 8 )]
transform = Transform( 3.93403e-08, 0, 0.3, 0, 0.3, 0, -0.3, 0, 3.93403e-08, 20.9294, 0.0805511, -27.7275 )
[node name="Wall17" parent="Misc" index="5" instance=ExtResource( 8 )]
transform = Transform( 3.93403e-08, 0, 0.3, 0, 0.3, 0, -0.3, 0, 3.93403e-08, 20.9294, 0.0805511, -13.7275 )
[node name="Wall2" parent="Misc" index="6" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, 0.3, 0, 0.3, 0, -0.3, 0, -1.31134e-08, -7.07064, 0.0805511, 0.272517 )
[node name="Wall4" parent="Misc" index="7" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, 0.3, 0, 0.3, 0, -0.3, 0, -1.31134e-08, -7.07064, 0.0805511, -14.7275 )
[node name="Wall7" parent="Misc" index="8" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, 0.3, 0, 0.3, 0, -0.3, 0, -1.31134e-08, -7.07064, 0.0805511, -27.7275 )
[node name="Wall12" parent="Misc" index="9" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, 0.3, 0, 0.3, 0, -0.3, 0, -1.31134e-08, -7.07064, 0.0805511, -41.7275 )
[node name="Wall13" parent="Misc" index="10" instance=ExtResource( 8 )]
transform = Transform( 3.93403e-08, 0, -0.3, 0, 0.3, 0, 0.3, 0, 3.93403e-08, 34.9294, 0.0805511, -41.7275 )
[node name="Wall14" parent="Misc" index="11" instance=ExtResource( 8 )]
transform = Transform( 0.3, 0, 5.24537e-08, 0, 0.3, 0, -5.24537e-08, 0, 0.3, 27.9293, 0.0805511, -49.2076 )
[node name="Wall18" parent="Misc" index="12" instance=ExtResource( 8 )]
transform = Transform( -0.3, 0, -1.86265e-08, 0, 0.3, 0, 1.86265e-08, 0, -0.3, 27.9294, 0.0805511, -6.5608 )
[node name="Wall15" parent="Misc" index="13" instance=ExtResource( 8 )]
transform = Transform( 0.3, 0, 5.24537e-08, 0, 0.3, 0, -5.24537e-08, 0, 0.3, -0.0706501, 0.0805511, -49.2076 )
[node name="Wall9" parent="Misc" index="14" instance=ExtResource( 8 )]
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 14.0682, 0.0805511, -48.8663 )
[node name="Wall10" parent="Misc" index="15" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, -0.3, 0, 0.3, 0, 0.3, 0, -1.31134e-08, 35.2071, 0.0805511, -27.7275 )
[node name="Wall16" parent="Misc" index="16" instance=ExtResource( 8 )]
transform = Transform( -1.31134e-08, 0, -0.3, 0, 0.3, 0, 0.3, 0, -1.31134e-08, 35.2071, 0.0805511, -13.7275 )
[node name="Wall3" parent="Misc" index="17" instance=ExtResource( 8 )]
transform = Transform( -0.298858, 0, -0.0261467, 0, 0.3, 0, 0.0261467, 0, -0.298858, -0.214372, 0.0805511, 7.29681 )
[node name="Control" type="Control" parent="." index="10"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 40.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
[node name="Label" type="Label" parent="Control" index="0"]
visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 49.0
margin_top = 47.0
margin_right = 1414.0
margin_bottom = 214.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 2 )
text = "Congratulations, you made it!"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
[node name="Label2" type="Label" parent="Control" index="1"]
visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 184.0
margin_top = 280.0
margin_right = 780.0
margin_bottom = 420.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 3 )
text = "It only took you:"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.73735, 0.000172973, -0.742473 )
[node name="Label3" type="Label" parent="Control" index="2"]
[node name="ImpEnemy2" parent="." index="4" instance=ExtResource( 4 )]
visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 184.0
margin_top = 420.0
margin_right = 851.0
margin_bottom = 663.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 3 )
text = "And you still have:"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.97743, 0.000172973, -4.0161 )
[node name="Time" type="Label" parent="Control" index="3"]
[node name="GreaterImpEnemy" parent="." index="5" instance=ExtResource( 5 )]
visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 760.0
margin_top = 280.0
margin_right = 1356.0
margin_bottom = 420.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 3 )
text = "N min S sec"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.70159, 0, 4.95512 )
[node name="CardsLeft" type="Label" parent="Control" index="4"]
[node name="GreaterImpEnemy2" parent="." index="6" instance=ExtResource( 5 )]
visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 873.0
margin_top = 420.0
margin_right = 1469.0
margin_bottom = 540.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 3 )
text = "N cards left"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.26925, 0, 2.46145 )
[connection signal="body_entered" from="Room10/Area" to="Room10" method="_on_Area_body_entered"]

+ 40
- 15
assets/scenes/arena/ArenaInterior.tscn
File diff suppressed because it is too large
View File


+ 1
- 1
assets/scenes/arena/ArenaWall.tscn View File

@ -10,7 +10,7 @@ data = PoolVector3Array( 7, -0.5, 0.5, 7, -0.5, 1.5, 8, -0.5, 1.5, 8, -0.5, 1.5,
[node name="Wall" type="MeshInstance" index="0"]
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, -2.33928, 0.166666, -6.66869 )
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1


+ 21
- 0
assets/scenes/arena/Finish.gd View File

@ -0,0 +1,21 @@
extends Spatial
var start_time
var won = false
func _ready():
start_time = OS.get_unix_time()
func show_victory():
for child in get_parent().get_node("Control").get_children():
child.visible = true
var time = OS.get_unix_time() - start_time
var minutes = time / 60
var seconds = time % 60
get_parent().get_node("Control/Time").text = str(minutes) + " min " + str(seconds) + " sec"
get_parent().get_node("Control/CardsLeft").text = str(len(get_parent().get_node("Player/Head/Deck").hand)) + " cards left"
func _on_Area_body_entered(body):
if not won and body.has_method("type_player"):
won = true
show_victory()

+ 41
- 0
assets/scenes/arena/RandomCard.gd View File

@ -0,0 +1,41 @@
extends Spatial
var cards = [
load("res://assets/scenes/cards/CardFire.tscn"),
load("res://assets/scenes/cards/CardIce.tscn"),
load("res://assets/scenes/cards/CardShock.tscn"),
]
var card_ref
var movement = Vector3()
var sound_delay = (randi() % 100) / 1000.0
func _ready():
var new_card = cards[randi() % len(cards)].instance()
new_card.scale *= 1.5
new_card.translation += Vector3(0, 0.4, 0)
add_child(new_card)
card_ref = weakref(new_card)
func move():
movement = Vector3((randi() % 100) / 50.0 - 1.0, (randi() % 100) / 50.0, (randi() % 100) / 50.0 - 1.0)
movement = movement.normalized() * 5
func _process(delta):
if sound_delay > 0:
sound_delay -= delta
if sound_delay <= 0:
$SfxSpawn.play()
sound_delay = 0
move()
else:
var card = card_ref.get_ref()
if card and card.get_parent() == self:
var pos = card.translation
if pos.y > 0.3:
pos += movement * delta
movement.y -= 9.8 * delta
else:
pos.y = sin(OS.get_ticks_msec() / 300.0) * 0.1 + 0.2
card.translation = pos

+ 34
- 0
assets/scenes/arena/RandomCard.tscn View File

@ -0,0 +1,34 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/scenes/arena/RandomCard.gd" type="Script" id=1]
[ext_resource path="res://assets/sfx/shing.wav" type="AudioStream" id=2]
[sub_resource type="AudioStreamRandomPitch" id=1]
audio_stream = ExtResource( 2 )
random_pitch = 1.05
[node name="RandomCard" type="Spatial" index="0"]
script = ExtResource( 1 )
[node name="SfxSpawn" type="AudioStreamPlayer3D" parent="." index="0"]
stream = SubResource( 1 )
attenuation_model = 0
unit_db = 0.0
unit_size = 1.0
max_db = 3.0
autoplay = false
max_distance = 0.0
out_of_range_mode = 0
bus = "Master"
area_mask = 1
emission_angle_enabled = false
emission_angle_degrees = 45.0
emission_angle_filter_attenuation_db = -12.0
attenuation_filter_cutoff_hz = 5000.0
attenuation_filter_db = -24.0
doppler_tracking = 0

+ 34
- 0
assets/scenes/arena/Spawner.gd View File

@ -0,0 +1,34 @@
extends Spatial
const TRIGGER_LENGTH = 1
const START_HEIGHT = 10
var enemies
var trigger_time = -1
func _ready():
enemies = $Enemies
for child in enemies.get_children():
child.set_process(false)
child.set_physics_process(false)
enemies.translation.y = START_HEIGHT
enemies.visible = false
func _process(delta):
if trigger_time > 0:
trigger_time -= delta
if trigger_time < 0:
trigger_time = 0
activate_enemies()
enemies.translation.y = pow(trigger_time / TRIGGER_LENGTH, 2) * START_HEIGHT
func activate_enemies():
for child in enemies.get_children():
child.set_process(true)
child.set_physics_process(true)
func _on_Area_body_entered(body):
if body.has_method("type_player") and trigger_time == -1:
trigger_time = TRIGGER_LENGTH
enemies.visible = true

+ 47
- 0
assets/scenes/arena/Spawner.tscn View File

@ -0,0 +1,47 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://assets/scenes/arena/Spawner.gd" type="Script" id=1]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 6, 1, 6 )
[node name="Spawner" type="Spatial"]
script = ExtResource( 1 )
_sections_unfolded = [ "Transform" ]
[node name="Area" type="Area" parent="." index="0"]
input_ray_pickable = false
input_capture_on_drag = false
space_override = 0
gravity_point = false
gravity_distance_scale = 0.0
gravity_vec = Vector3( 0, -1, 0 )
gravity = 9.8
linear_damp = 0.1
angular_damp = 1.0
priority = 0.0
monitoring = true
monitorable = true
collision_layer = 1
collision_mask = 1
audio_bus_override = false
audio_bus_name = "Master"
reverb_bus_enable = false
reverb_bus_name = "Master"
reverb_bus_amount = 0.0
reverb_bus_uniformity = 0.0
_sections_unfolded = [ "Transform" ]
[node name="CollisionShape" type="CollisionShape" parent="Area" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.756626, 0 )
shape = SubResource( 1 )
disabled = false
_sections_unfolded = [ "Transform" ]
[connection signal="body_entered" from="Area" to="." method="_on_Area_body_entered"]

+ 0
- 1
assets/scenes/cards/CardBase.gd View File

@ -17,7 +17,6 @@ var picked_up = false
func _ready():
body = $CardBody
$CardBody/HomingArea.scale = Vector3(2, 2, 2)
var mesh = $Mesh
remove_child(mesh)
body.add_child(mesh)


+ 3
- 37
assets/scenes/cards/CardBody.tscn View File

@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=2]
[gd_scene load_steps=16 format=2]
[ext_resource path="res://assets/sfx/bop.wav" type="AudioStream" id=1]
[ext_resource path="res://assets/sfx/ding.wav" type="AudioStream" id=2]
@ -48,10 +48,6 @@ func type_card():
extents = Vector3( 0.1, 0.15, 0.015 )
[sub_resource type="SphereShape" id=3]
radius = 1.0
[sub_resource type="ParticlesMaterial" id=4]
render_priority = 0
@ -366,7 +362,7 @@ random_pitch = 1.1
audio_stream = ExtResource( 2 )
random_pitch = 1.1
[node name="CardBody" type="KinematicBody" index="0"]
[node name="CardBody" type="KinematicBody"]
input_ray_pickable = true
input_capture_on_drag = false
@ -389,37 +385,7 @@ shape = SubResource( 2 )
disabled = false
_sections_unfolded = [ "Transform" ]
[node name="HomingArea" type="Area" parent="." index="1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.15 )
input_ray_pickable = false
input_capture_on_drag = false
space_override = 0
gravity_point = false
gravity_distance_scale = 0.0
gravity_vec = Vector3( 0, -1, 0 )
gravity = 9.8
linear_damp = 0.1
angular_damp = 1.0
priority = 0.0
monitoring = true
monitorable = true
collision_layer = 1
collision_mask = 1
audio_bus_override = false
audio_bus_name = "Master"
reverb_bus_enable = false
reverb_bus_name = "Master"
reverb_bus_amount = 0.0
reverb_bus_uniformity = 0.0
_sections_unfolded = [ "Transform" ]
[node name="CollisionShape" type="CollisionShape" parent="HomingArea" index="0"]
shape = SubResource( 3 )
disabled = false
[node name="Fx" type="Spatial" parent="." index="2"]
[node name="Fx" type="Spatial" parent="." index="1"]
[node name="Explosion" type="Particles" parent="Fx" index="0"]


+ 1
- 1
assets/scenes/cards/CardFire.tscn View File

@ -8,7 +8,7 @@
script/source = "# FIRE CARD #
extends \"res://assets/scenes/cards/CardBase.gd\"
const DAMAGE = 2
const DAMAGE = 1
const BONUS_DAMAGE = 1
const FIRE_STACKS = 2


+ 6
- 6
assets/scenes/cards/CardIce.tscn View File

@ -3,13 +3,13 @@
[ext_resource path="res://assets/model/CardIce.mesh" type="ArrayMesh" id=1]
[ext_resource path="res://assets/scenes/cards/CardBody.tscn" type="PackedScene" id=2]
[sub_resource type="GDScript" id=1]
[sub_resource type="GDScript" id=2]
script/source = "# FREEZE CARD #
extends \"res://assets/scenes/cards/CardBase.gd\"
const DAMAGE = 2
const BONUS_DAMAGE = 3
const DAMAGE = 1
const BONUS_DAMAGE = 2
const FREEZE_TIME = 1.5
func hit(enemy):
@ -26,7 +26,7 @@ func hit(enemy):
return false
"
[sub_resource type="Shader" id=2]
[sub_resource type="Shader" id=4]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
@ -76,7 +76,7 @@ void fragment() {
[sub_resource type="ShaderMaterial" id=3]
render_priority = 0
shader = SubResource( 2 )
shader = SubResource( 4 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
@ -94,7 +94,7 @@ shader_param/uv2_offset = Vector3( 0, 0, 0 )
[node name="CardIce" type="Spatial"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.0851803, 0 )
script = SubResource( 1 )
script = SubResource( 2 )
_sections_unfolded = [ "Transform" ]
[node name="Mesh" type="MeshInstance" parent="." index="0"]


+ 5
- 5
assets/scenes/cards/CardShock.tscn View File

@ -3,12 +3,12 @@
[ext_resource path="res://assets/model/CardShock.mesh" type="ArrayMesh" id=1]
[ext_resource path="res://assets/scenes/cards/CardBody.tscn" type="PackedScene" id=2]
[sub_resource type="GDScript" id=1]
[sub_resource type="GDScript" id=3]
script/source = "# SHOCK CARD #
extends \"res://assets/scenes/cards/CardBase.gd\"
const DAMAGE = 2
const DAMAGE = 1
const BONUS_DAMAGE = 1
const STUN_TIME = 0.5
@ -71,7 +71,7 @@ void fragment() {
}
"
[sub_resource type="ShaderMaterial" id=3]
[sub_resource type="ShaderMaterial" id=4]
render_priority = 0
shader = SubResource( 2 )
@ -93,7 +93,7 @@ _sections_unfolded = [ "shader_param" ]
[node name="CardShock" type="Spatial"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.0851803, 0 )
script = SubResource( 1 )
script = SubResource( 3 )
_sections_unfolded = [ "Transform" ]
[node name="Mesh" type="MeshInstance" parent="." index="0"]
@ -110,7 +110,7 @@ lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 3 )
material/0 = SubResource( 4 )
_sections_unfolded = [ "Transform", "material" ]
[node name="CardBody" parent="." index="1" instance=ExtResource( 2 )]


+ 7
- 3
assets/scenes/enemies/BaseEnemy.gd View File

@ -5,7 +5,6 @@ const FROZEN_SPEED_MULTIPLIER = 0.3
var max_health = 4
var health = max_health
var health_indicator
var on_fire = 0
var fire_cooldown = 0
@ -31,6 +30,8 @@ var offset_pos = Vector3()
var offset_rot = Vector3()
var offset_time = randi() % 100
var random_card = load("res://assets/scenes/arena/RandomCard.tscn")
# Something like an alternative super constructor for all enemies
func init(health_, move_speed_):
max_health = health_
@ -44,7 +45,6 @@ func _ready():
mesh = $Mesh
remove_child(mesh)
body.add_child(mesh)
health_indicator = $Body/HealthIndicator
on_fire_indicator = $Body/OnFireIndicator
frozen_indicator = $Body/FrozenIndicator
stun_indicator = $Body/StunIndicator
@ -67,7 +67,6 @@ func _process(delta):
stun_time -= delta
# Indicators
health_indicator.scale = Vector3(1, float(health) / max_health, 1)
frozen_indicator.visible = frozen_time > 0
on_fire_indicator.visible = on_fire > 0
stun_indicator.visible = stun_time > 0
@ -79,6 +78,11 @@ func _process(delta):
body.remove_child(sfx_death)
$"/root/Arena".add_child(sfx_death)
sfx_death.global_transform = prev_transform
var random_cards = randi() % max_health * 1.1 + 1
for i in range(random_cards):
var card = random_card.instance()
$"/root/Arena".add_child(card)
card.global_transform.origin = body.global_transform.origin
queue_free()
# Animation


+ 274
- 116
assets/scenes/enemies/EnemyBody.tscn View File

@ -1,4 +1,4 @@
[gd_scene load_steps=26 format=2]
[gd_scene load_steps=27 format=2]
[ext_resource path="res://assets/model/FireFx.mesh" type="ArrayMesh" id=1]
[ext_resource path="res://assets/model/IceFx.mesh" type="ArrayMesh" id=2]
@ -7,24 +7,30 @@
[ext_resource path="res://assets/sfx/enemy_death.wav" type="AudioStream" id=5]
[ext_resource path="res://assets/sfx/munch.wav" type="AudioStream" id=6]
[ext_resource path="res://assets/sfx/growl.wav" type="AudioStream" id=7]
[ext_resource path="res://assets/model/Heart.mesh" type="ArrayMesh" id=8]
[sub_resource type="GDScript" id=1]
script/source = "# Enemy Body #
extends KinematicBody
const MAX_HEARTS = 9
var initial = true
var fx_fire
var fx_freeze
var fx_stun
var fx_death
var base_scale
var heart_scale = []
func _ready():
fx_fire = $OnFireIndicator
fx_freeze = $FrozenIndicator
fx_stun = $StunIndicator
fx_death = $DeathFx
for i in range(MAX_HEARTS):
heart_scale.append(0)
func _process(delta):
if initial:
@ -57,6 +63,9 @@ func _process(delta):
rot = fx_stun.rotation_degrees
rot.y = time_angle
fx_stun.rotation_degrees = rot
# Hearts
update_hearts(delta)
func explode():
fx_death.emitting = true
@ -70,6 +79,15 @@ func set_explosion_size(n):
func _on_Area_body_entered(body):
get_parent()._on_Area_body_entered(body)
func update_hearts(delta):
for i in range(MAX_HEARTS):
var heart = get_node(\"Hearts/Heart\" + str(i))
if get_parent().health > i:
heart_scale[i] = clamp((1 - heart_scale[i]) * 0.75, 0, 1)
else:
heart_scale[i] = clamp(heart_scale[i] * 0.75, 0, 1)
heart.scale = Vector3(1, 1, 1) * 0.1 * heart_scale[i]
"
[sub_resource type="CapsuleShape" id=2]
@ -77,7 +95,7 @@ func _on_Area_body_entered(body):
radius = 0.5
height = 0.4
[sub_resource type="Shader" id=10]
[sub_resource type="Shader" id=3]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
@ -123,10 +141,10 @@ void fragment() {
}
"
[sub_resource type="ShaderMaterial" id=11]
[sub_resource type="ShaderMaterial" id=4]
render_priority = 0
shader = SubResource( 10 )
shader = SubResource( 3 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
@ -142,7 +160,7 @@ shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
_sections_unfolded = [ "shader_param" ]
[sub_resource type="Shader" id=12]
[sub_resource type="Shader" id=5]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
@ -188,10 +206,10 @@ void fragment() {
}
"
[sub_resource type="ShaderMaterial" id=13]
[sub_resource type="ShaderMaterial" id=6]
render_priority = 0
shader = SubResource( 12 )
shader = SubResource( 5 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
@ -206,7 +224,7 @@ shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
[sub_resource type="Shader" id=14]
[sub_resource type="Shader" id=21]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
@ -252,10 +270,10 @@ void fragment() {
}
"
[sub_resource type="ShaderMaterial" id=15]
[sub_resource type="ShaderMaterial" id=22]
render_priority = 0
shader = SubResource( 14 )
shader = SubResource( 21 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
@ -270,72 +288,12 @@ shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
[sub_resource type="SpatialMaterial" id=7]
render_priority = 0
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 0.320312, 0.320312, 1 )
metallic = 0.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 0.0
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo" ]
[sub_resource type="CubeMesh" id=8]
material = SubResource( 7 )
size = Vector3( 0.3, 0.3, 0.3 )
subdivide_width = 0
subdivide_height = 0
subdivide_depth = 0
[sub_resource type="CapsuleShape" id=9]
[sub_resource type="CapsuleShape" id=11]
radius = 0.6
height = 1.0
[sub_resource type="ParticlesMaterial" id=16]
[sub_resource type="ParticlesMaterial" id=12]
render_priority = 0
trail_divisor = 1
@ -373,7 +331,7 @@ anim_offset_random = 0.0
anim_loop = false
_sections_unfolded = [ "Emission Shape", "Gravity", "Initial Velocity", "Linear Accel", "Spread" ]
[sub_resource type="SpatialMaterial" id=18]
[sub_resource type="SpatialMaterial" id=13]
render_priority = 0
flags_transparent = false
@ -429,34 +387,99 @@ proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo", "Emission" ]
[sub_resource type="CubeMesh" id=17]
[sub_resource type="CubeMesh" id=14]
material = SubResource( 18 )
material = SubResource( 13 )
size = Vector3( 0.1, 0.1, 0.1 )
subdivide_width = 0
subdivide_height = 0
subdivide_depth = 0
[sub_resource type="AudioStreamRandomPitch" id=19]
[sub_resource type="AudioStreamRandomPitch" id=15]
audio_stream = ExtResource( 4 )
random_pitch = 1.1
[sub_resource type="AudioStreamRandomPitch" id=20]
[sub_resource type="AudioStreamRandomPitch" id=16]
audio_stream = ExtResource( 5 )
random_pitch = 1.1
[sub_resource type="AudioStreamRandomPitch" id=21]
[sub_resource type="AudioStreamRandomPitch" id=17]
audio_stream = ExtResource( 6 )
random_pitch = 1.1
[sub_resource type="AudioStreamRandomPitch" id=22]
[sub_resource type="AudioStreamRandomPitch" id=18]
audio_stream = ExtResource( 7 )
random_pitch = 1.1
[sub_resource type="Shader" id=19]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_metallic : hint_white;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_white;
uniform vec4 roughness_texture_channel;
uniform sampler2D texture_emission : hint_black_albedo;
uniform vec4 emission : hint_color;
uniform float emission_energy;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
COLOR.rgb = mix( pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), COLOR.rgb* (1.0 / 12.92), lessThan(COLOR.rgb,vec3(0.04045)) );
UV=UV*uv1_scale.xy+uv1_offset.xy;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
vec3 emission_tex = texture(texture_emission,base_uv).rgb;
EMISSION = (emission.rgb+emission_tex+COLOR.rgb)*emission_energy;
}
"
[sub_resource type="ShaderMaterial" id=20]
render_priority = 0
shader = SubResource( 19 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
shader_param/roughness = 0.0
shader_param/point_size = 1.0
shader_param/metallic_texture_channel = Plane( 1, 0, 0, 0 )
shader_param/roughness_texture_channel = Plane( 1, 0, 0, 0 )
shader_param/emission = Color( 0.078125, 0.078125, 0.078125, 1 )
shader_param/emission_energy = 1.6
shader_param/uv1_scale = Vector3( 1, 1, 1 )
shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
_sections_unfolded = [ "shader_param" ]
[node name="Body" type="KinematicBody"]
input_ray_pickable = true
@ -494,7 +517,7 @@ lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 11 )
material/0 = SubResource( 4 )
_sections_unfolded = [ "Transform", "material" ]
[node name="FrozenIndicator" type="MeshInstance" parent="." index="2"]
@ -512,7 +535,7 @@ lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 2 )
skeleton = NodePath("..")
material/0 = SubResource( 13 )
material/0 = SubResource( 6 )
_sections_unfolded = [ "Transform", "material" ]
[node name="StunIndicator" type="MeshInstance" parent="." index="3"]
@ -530,32 +553,12 @@ lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 3 )
skeleton = NodePath("..")
material/0 = SubResource( 15 )
material/0 = SubResource( 22 )
_sections_unfolded = [ "Transform", "material" ]
[node name="HealthIndicator" type="Spatial" parent="." index="4"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1464, 0 )
[node name="HealthMesh" type="MeshInstance" parent="HealthIndicator" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.149827, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 8 )
skeleton = NodePath("..")
material/0 = null
_sections_unfolded = [ "material" ]
[node name="Area" type="Area" parent="." index="5"]
[node name="Area" type="Area" parent="." index="4"]
editor/display_folded = true
input_ray_pickable = false
input_capture_on_drag = false
space_override = 0
@ -580,10 +583,10 @@ reverb_bus_uniformity = 0.0
[node name="CollisionShape" type="CollisionShape" parent="Area" index="0"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.533478, 0 )
shape = SubResource( 9 )
shape = SubResource( 11 )
disabled = false
[node name="DeathFx" type="Particles" parent="." index="6"]
[node name="DeathFx" type="Particles" parent="." index="5"]
transform = Transform( 0.1, -1.74846e-08, -3.01876e-12, -3.01876e-12, -3.45306e-05, 0.1, -1.74846e-08, -0.1, -3.45306e-05, 0, 0.592887, 0 )
layers = 1
@ -608,14 +611,14 @@ fract_delta = true
visibility_aabb = AABB( -30, -30, -40, 60, 60, 80 )
local_coords = false
draw_order = 0
process_material = SubResource( 16 )
process_material = SubResource( 12 )
draw_passes = 1
draw_pass_1 = SubResource( 17 )
draw_pass_1 = SubResource( 14 )
_sections_unfolded = [ "Draw Passes", "Drawing", "Process Material", "Time", "Transform" ]
[node name="SfxFootstep" type="AudioStreamPlayer3D" parent="." index="7"]
[node name="SfxFootstep" type="AudioStreamPlayer3D" parent="." index="6"]
stream = SubResource( 19 )
stream = SubResource( 15 )
attenuation_model = 0
unit_db = -5.0
unit_size = 1.0
@ -632,9 +635,9 @@ attenuation_filter_cutoff_hz = 5000.0
attenuation_filter_db = -24.0
doppler_tracking = 0
[node name="SfxDeath" type="AudioStreamPlayer3D" parent="." index="8"]
[node name="SfxDeath" type="AudioStreamPlayer3D" parent="." index="7"]
stream = SubResource( 20 )
stream = SubResource( 16 )
attenuation_model = 0
unit_db = 5.0
unit_size = 1.0
@ -651,9 +654,9 @@ attenuation_filter_cutoff_hz = 5000.0
attenuation_filter_db = -24.0
doppler_tracking = 0
[node name="SfxMunch" type="AudioStreamPlayer3D" parent="." index="9"]
[node name="SfxMunch" type="AudioStreamPlayer3D" parent="." index="8"]
stream = SubResource( 21 )
stream = SubResource( 17 )
attenuation_model = 0
unit_db = 5.0
unit_size = 1.0
@ -670,9 +673,9 @@ attenuation_filter_cutoff_hz = 5000.0
attenuation_filter_db = -24.0
doppler_tracking = 0
[node name="SfxGrowl" type="AudioStreamPlayer3D" parent="." index="10"]
[node name="SfxGrowl" type="AudioStreamPlayer3D" parent="." index="9"]
stream = SubResource( 22 )
stream = SubResource( 18 )
attenuation_model = 0
unit_db = 20.0
unit_size = 1.0
@ -689,6 +692,161 @@ attenuation_filter_cutoff_hz = 5000.0
attenuation_filter_db = -24.0
doppler_tracking = 0
[node name="Hearts" type="Spatial" parent="." index="10"]
[node name="Heart0" type="MeshInstance" parent="Hearts" index="0"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0, 1.53561, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart1" type="MeshInstance" parent="Hearts" index="1"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.454553, 1.53561, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart2" type="MeshInstance" parent="Hearts" index="2"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.469171, 1.53561, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart3" type="MeshInstance" parent="Hearts" index="3"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.235235, 1.90678, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart4" type="MeshInstance" parent="Hearts" index="4"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.225488, 1.90678, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart5" type="MeshInstance" parent="Hearts" index="5"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.00192507, 2.28918, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart6" type="MeshInstance" parent="Hearts" index="6"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0.476765, 2.28918, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart7" type="MeshInstance" parent="Hearts" index="7"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.486667, 2.28918, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Heart8" type="MeshInstance" parent="Hearts" index="8"]
transform = Transform( 0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, -0.00256413, 2.711, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 8 )
skeleton = NodePath("..")
material/0 = SubResource( 20 )
_sections_unfolded = [ "Transform", "material" ]
[connection signal="body_entered" from="Area" to="." method="_on_Area_body_entered"]

+ 10
- 6
assets/scenes/player/Deck.gd View File

@ -6,6 +6,7 @@ const CARD_DRAW_TIME = 0.2
var camera
var deck_mesh
var sfx_draw
var sfx_retrieve
var sfx_throw
# Cards
@ -14,7 +15,11 @@ var current_card
var card_drawn = false
var drawing_card_time = 0
var card_draw_requested = false
var cards
var cards = [
load("res://assets/scenes/cards/CardFire.tscn"),
load("res://assets/scenes/cards/CardIce.tscn"),
load("res://assets/scenes/cards/CardShock.tscn"),
]
var hand = []
var moving_card_start_position
var moving_card_end_position
@ -27,12 +32,8 @@ func _ready():
deck_mesh = $"Left Hand/Deck"
card_hand = $"Right Hand/CardHolder"
sfx_draw = $SfxDraw
sfx_retrieve = $SfxRetrieve
sfx_throw = $SfxThrow
cards = [
load("res://assets/scenes/cards/CardFire.tscn"),
load("res://assets/scenes/cards/CardIce.tscn"),
load("res://assets/scenes/cards/CardShock.tscn"),
]
for i in range(DECK_MAX):
var new_card = cards[randi() % len(cards)].instance()
add_card(new_card)
@ -52,6 +53,8 @@ func add_card(card):
card.rotation_degrees = rot
card.translation = pos
hand.push_front(card)
if not sfx_retrieve.playing:
sfx_retrieve.play()
func _process(delta):
if Input.is_action_just_pressed("throw_card"):
@ -149,6 +152,7 @@ func drop_card():
current_card.global_transform = transform
current_card = null
card_drawn = false
request_card()
# Signals


+ 27
- 13
assets/scenes/player/Deck.tscn View File

@ -1,22 +1,23 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://assets/scenes/player/Deck.gd" type="Script" id=1]
[ext_resource path="res://assets/sfx/card_draw.wav" type="AudioStream" id=2]
[ext_resource path="res://assets/sfx/card_throw.wav" type="AudioStream" id=3]
[ext_resource path="res://assets/sfx/card_retrieve.wav" type="AudioStream" id=3]
[ext_resource path="res://assets/sfx/card_throw.wav" type="AudioStream" id=4]
[sub_resource type="BoxShape" id=2]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.907593, 0.75, 0.75 )
[sub_resource type="BoxShape" id=3]
[sub_resource type="BoxShape" id=2]
extents = Vector3( 1.88651, 1, 1.5 )
[sub_resource type="BoxShape" id=4]
[sub_resource type="BoxShape" id=3]
extents = Vector3( 3.43984, 1, 3 )
[sub_resource type="AudioStreamRandomPitch" id=5]
[sub_resource type="AudioStreamRandomPitch" id=4]
audio_stream = ExtResource( 2 )
random_pitch = 1.1
@ -26,7 +27,12 @@ random_pitch = 1.1
audio_stream = ExtResource( 3 )
random_pitch = 1.1
[node name="Deck" type="Spatial"]
[sub_resource type="AudioStreamRandomPitch" id=5]
audio_stream = ExtResource( 4 )
random_pitch = 1.1
[node name="Deck" type="Spatial" index="0"]
script = ExtResource( 1 )
@ -92,32 +98,40 @@ reverb_bus_uniformity = 0.0
[node name="CollisionShape" type="CollisionShape" parent="TargetingArea" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -4 )
shape = SubResource( 2 )
shape = SubResource( 1 )
disabled = false
[node name="CollisionShape2" type="CollisionShape" parent="TargetingArea" index="1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.010596, -0.00778627, -6.10542 )
shape = SubResource( 3 )
shape = SubResource( 2 )
disabled = false
[node name="CollisionShape3" type="CollisionShape" parent="TargetingArea" index="2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -10.4798 )
shape = SubResource( 4 )
shape = SubResource( 3 )
disabled = false
[node name="SfxDraw" type="AudioStreamPlayer" parent="." index="4"]
stream = SubResource( 5 )
volume_db = -25.0
stream = SubResource( 4 )
volume_db = -15.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="SfxThrow" type="AudioStreamPlayer" parent="." index="5"]
[node name="SfxRetrieve" type="AudioStreamPlayer" parent="." index="5"]
stream = SubResource( 6 )
volume_db = -25.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="SfxThrow" type="AudioStreamPlayer" parent="." index="6"]
stream = SubResource( 5 )
volume_db = 0.0
autoplay = false
mix_target = 0