they say i'm the best at handling balls
This commit is contained in:
parent
a40347a52f
commit
d3e402bb5b
7 changed files with 137 additions and 0 deletions
|
@ -117,6 +117,9 @@ func _enter_code():
|
||||||
"MACOSX":
|
"MACOSX":
|
||||||
var player = get_tree().get_nodes_in_group("player").pop_back()
|
var player = get_tree().get_nodes_in_group("player").pop_back()
|
||||||
if player != null: Game.instance_node(load("res://objects/environment/beach_ball/beach_ball.tscn"),player.global_position.x,player.global_position.y - 8,Game.get_map())
|
if player != null: Game.instance_node(load("res://objects/environment/beach_ball/beach_ball.tscn"),player.global_position.x,player.global_position.y - 8,Game.get_map())
|
||||||
|
"CANYOUDUNK":
|
||||||
|
var player = get_tree().get_nodes_in_group("player").pop_back()
|
||||||
|
if player != null: Game.instance_node(preload("res://objects/environment/zball/zball.tscn"),player.global_position.x,player.global_position.y - 18.0,Game.get_map())
|
||||||
"YUMMY":
|
"YUMMY":
|
||||||
var player = get_tree().get_nodes_in_group("player").pop_back()
|
var player = get_tree().get_nodes_in_group("player").pop_back()
|
||||||
if player != null:
|
if player != null:
|
||||||
|
|
BIN
graphics/secret/zball.png
Normal file
BIN
graphics/secret/zball.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 656 B |
35
graphics/secret/zball.png.import
Normal file
35
graphics/secret/zball.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/zball.png-766d895c88e3cffc348d3ca2bc047df8.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/secret/zball.png"
|
||||||
|
dest_files=[ "res://.import/zball.png-766d895c88e3cffc348d3ca2bc047df8.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
BIN
graphics/secret/zball_glow.png
Normal file
BIN
graphics/secret/zball_glow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 643 B |
35
graphics/secret/zball_glow.png.import
Normal file
35
graphics/secret/zball_glow.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/zball_glow.png-a903baaaddcbe84df17501813dffd3fd.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/secret/zball_glow.png"
|
||||||
|
dest_files=[ "res://.import/zball_glow.png-a903baaaddcbe84df17501813dffd3fd.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
27
objects/environment/zball/zball.gd
Normal file
27
objects/environment/zball/zball.gd
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
extends RigidBody2D
|
||||||
|
|
||||||
|
|
||||||
|
export var max_glow: float = 5.0
|
||||||
|
|
||||||
|
|
||||||
|
onready var glow: Light2D = $Glow
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Hurtbox_area_entered(area: Area2D) -> void:
|
||||||
|
if area.is_in_group("enemy_hitbox"):
|
||||||
|
var target = area.get_parent()
|
||||||
|
target.die()
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
var speed: float = inverse_lerp(0.0, 250.0, linear_velocity.length())
|
||||||
|
print(speed)
|
||||||
|
glow.energy = lerp(0.0, max_glow, speed)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_body_entered(body: Node) -> void:
|
||||||
|
pass
|
||||||
|
# if glow.energy < max_glow:
|
||||||
|
# pass
|
||||||
|
# glow.energy += glow_increase
|
||||||
|
# smoke_particles.amount += 1
|
37
objects/environment/zball/zball.tscn
Normal file
37
objects/environment/zball/zball.tscn
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
[gd_scene load_steps=6 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://objects/environment/zball/zball.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://graphics/secret/zball.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://graphics/secret/zball_glow.png" type="Texture" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="PhysicsMaterial" id=2]
|
||||||
|
bounce = 0.75
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id=1]
|
||||||
|
radius = 4.0
|
||||||
|
|
||||||
|
[node name="ZBall" type="RigidBody2D"]
|
||||||
|
mass = 5.0
|
||||||
|
physics_material_override = SubResource( 2 )
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
light_mask = 9
|
||||||
|
texture = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Glow" type="Light2D" parent="."]
|
||||||
|
texture = ExtResource( 3 )
|
||||||
|
energy = 5.0
|
||||||
|
range_item_cull_mask = 8
|
||||||
|
|
||||||
|
[node name="Hurtbox" type="Area2D" parent="."]
|
||||||
|
collision_mask = 5
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"]
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
|
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue