tophud (wip)
This commit is contained in:
parent
c7c89f5414
commit
6b5f8dd609
19 changed files with 737 additions and 24 deletions
|
@ -22,6 +22,9 @@ func _physics_process(delta):
|
|||
|
||||
func _on_body_entered(body):
|
||||
if !body.is_in_group(btype):
|
||||
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
|
||||
if body.weakness == 3:
|
||||
print("weak to fire")
|
||||
#if body.is_in_group("players"):
|
||||
# Global.live = 2
|
||||
#elif body.is_in_group("enemies"):
|
||||
|
|
44
sprites/common/bullet/snowflake.gd
Normal file
44
sprites/common/bullet/snowflake.gd
Normal file
|
@ -0,0 +1,44 @@
|
|||
extends Area2D
|
||||
var velocity: Vector2 = Vector2()
|
||||
var direction
|
||||
var speed = 100
|
||||
var btype
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
add_to_group(btype)
|
||||
#pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func _physics_process(delta):
|
||||
if direction == null:
|
||||
position += velocity * delta
|
||||
else:
|
||||
position += speed * delta * direction
|
||||
|
||||
|
||||
func _on_body_entered(body):
|
||||
if !body.is_in_group(btype):
|
||||
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
|
||||
if body.weakness == 0:
|
||||
print("weak to ice")
|
||||
#if body.is_in_group("players"):
|
||||
# Global.live = 2
|
||||
#elif body.is_in_group("enemies"):
|
||||
# Global.live = 3
|
||||
#elif body.is_in_group("boss"):
|
||||
# Global.live = 3
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_screen_exited():
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_area_entered(area):
|
||||
if !area.is_in_group(btype):
|
||||
queue_free()
|
||||
#pass # Replace with function body.
|
BIN
sprites/common/bullet/snowflake.png
Normal file
BIN
sprites/common/bullet/snowflake.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
34
sprites/common/bullet/snowflake.png.import
Normal file
34
sprites/common/bullet/snowflake.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://nvayru3j13ts"
|
||||
path="res://.godot/imported/snowflake.png-955eeb363f6816e7809a87df0c75bf64.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/common/bullet/snowflake.png"
|
||||
dest_files=["res://.godot/imported/snowflake.png-955eeb363f6816e7809a87df0c75bf64.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
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
|
21
sprites/common/bullet/snowflake.tscn
Normal file
21
sprites/common/bullet/snowflake.tscn
Normal file
|
@ -0,0 +1,21 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cexo7mwqpmw4b"]
|
||||
|
||||
[ext_resource type="Script" path="res://sprites/common/bullet/snowflake.gd" id="1_w4m7a"]
|
||||
[ext_resource type="Texture2D" uid="uid://nvayru3j13ts" path="res://sprites/common/bullet/snowflake.png" id="2_0alhu"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"]
|
||||
size = Vector2(60, 60)
|
||||
|
||||
[node name="Snowflake" type="Area2D"]
|
||||
script = ExtResource("1_w4m7a")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_0alhu")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_g125y")
|
||||
|
||||
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
BIN
sprites/common/midori/facehud.png
Normal file
BIN
sprites/common/midori/facehud.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
34
sprites/common/midori/facehud.png.import
Normal file
34
sprites/common/midori/facehud.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ckjccj40wqboe"
|
||||
path="res://.godot/imported/facehud.png-853dc11b9d2eda9b4f3dbda0602e31cd.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/common/midori/facehud.png"
|
||||
dest_files=["res://.godot/imported/facehud.png-853dc11b9d2eda9b4f3dbda0602e31cd.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
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
|
|
@ -4,6 +4,7 @@ extends CharacterBody2D
|
|||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -400.0
|
||||
var angle = 2
|
||||
var weakness = 0
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
|
BIN
sprites/common/natasha/facehud.png
Normal file
BIN
sprites/common/natasha/facehud.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
34
sprites/common/natasha/facehud.png.import
Normal file
34
sprites/common/natasha/facehud.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cw2pkjwxw0mj0"
|
||||
path="res://.godot/imported/facehud.png-cabef45f07551c953d7df3ee19ee1aca.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/common/natasha/facehud.png"
|
||||
dest_files=["res://.godot/imported/facehud.png-cabef45f07551c953d7df3ee19ee1aca.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
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
|
|
@ -2,11 +2,12 @@ extends CharacterBody2D
|
|||
|
||||
var theta: float = 0.0
|
||||
@export_range(0,2*PI) var alpha: float = 1.5
|
||||
var bullet = load("res://sprites/common/bullet/fireball.tscn")
|
||||
var bullet = load("res://sprites/common/bullet/snowflake.tscn")
|
||||
|
||||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -400.0
|
||||
var vangle = 2
|
||||
var weakness = 2
|
||||
|
||||
func get_vector(angle):
|
||||
theta = angle + alpha
|
||||
|
|
|
@ -10,31 +10,20 @@ var csprite
|
|||
var bpress = false
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
var weakness
|
||||
|
||||
func _ready():
|
||||
add_to_group("players")
|
||||
anim = $AnimationPlayer
|
||||
sprite = $Sprite2D
|
||||
if Global.debug:
|
||||
csprite = Global.dcpchar
|
||||
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
|
||||
else:
|
||||
csprite = Global.cpchar
|
||||
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
|
||||
_charswitch()
|
||||
|
||||
func _physics_process(delta):
|
||||
# Add the gravity.
|
||||
#var velocity = Vector2.ZERO
|
||||
if Global.live == 1:
|
||||
velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta
|
||||
if Global.debug:
|
||||
if Global.dcpchar != csprite:
|
||||
csprite = Global.dcpchar
|
||||
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
|
||||
else:
|
||||
if Global.cpchar != csprite:
|
||||
csprite = Global.cpchar
|
||||
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
|
||||
_charswitch()
|
||||
#origmpos = get_viewport().get_mouse_position()
|
||||
#if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0:
|
||||
# velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
|
||||
|
@ -88,3 +77,15 @@ func _input(event):
|
|||
get_parent().add_child(new_pbullet)
|
||||
elif Input.is_action_just_released("shoot") && bpress:
|
||||
bpress = false
|
||||
|
||||
func _charswitch():
|
||||
if Global.debug:
|
||||
if Global.dcpchar != csprite:
|
||||
csprite = Global.dcpchar
|
||||
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
|
||||
weakness = Global.specialities[Global.pcspecialities[Global.dparty[Global.dcpchar]]]
|
||||
else:
|
||||
if Global.cpchar != csprite:
|
||||
csprite = Global.cpchar
|
||||
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
|
||||
weakness = Global.specialities[Global.pcspecialities[Global.party[Global.cpchar]]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue