forked from andreyratz/block
Code cleanup
Cleaned up various things in the code to make it easier for the next person
This commit is contained in:
56
todoList
56
todoList
@@ -2,12 +2,15 @@ So that we can keep track of what things need to be done
|
||||
|
||||
Using godot version 4.6
|
||||
|
||||
- Get sprites for basic characters, and background
|
||||
- collisions
|
||||
- projectiles
|
||||
- attack types?
|
||||
- Get sprites for and background
|
||||
- projectile damage
|
||||
- enemy attack types
|
||||
- enemy behaviors
|
||||
Done
|
||||
- WASD movement
|
||||
- projectiles launching
|
||||
- projectiles bouncing
|
||||
- Get sprites for basic characters,
|
||||
|
||||
|
||||
Current imported assests:
|
||||
@@ -15,9 +18,6 @@ https://screamingbrainstudios.itch.io/tiny-texture-pack
|
||||
|
||||
|
||||
|
||||
x1*x2+y1*y2
|
||||
|
||||
along normal speedx*sp
|
||||
|
||||
|
||||
|
||||
@@ -27,45 +27,3 @@ along normal speedx*sp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var proje_normal = global_transform.x.normalized()
|
||||
#proje_normal.y = -proje_normal.y
|
||||
print("Proje Normal: ", proje_normal)
|
||||
var speed_perp: float = proje_normal.dot(normal)
|
||||
var perp_line: Vector2 = Vector2(normal.y,-normal.x)
|
||||
var speed_para: float = proje_normal.dot(perp_line)
|
||||
print("speed perp: ", speed_perp)
|
||||
print("speed para: ", speed_para)
|
||||
# this is just to check my math
|
||||
# should be aproximately 1 (there will be some bit depth precision errors)
|
||||
print("speed hype: ", speed_para*speed_para + speed_perp*speed_perp)
|
||||
|
||||
var newDirection: Vector2 = Vector2(
|
||||
(speed_perp * normal.x) + (speed_para * normal.y),
|
||||
(speed_perp * normal.y) + (speed_para *-normal.x))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var projectile_velocity = area.get_parent().get_facing_direction()
|
||||
print("projectile speed......................", projectile_velocity)
|
||||
var shield_normal = global_transform.x.normalized()
|
||||
print("Shield Normal: ", shield_normal)
|
||||
#shield_normal.y = -shield_normal.y
|
||||
# if abs(projectile_velocity.y)>abs(projectile_velocity.x):
|
||||
# shield_normal = global_transform.y.normalized()
|
||||
#shield_normal.y = -shield_normal.y
|
||||
#shield_normal.x = -shield_normal.x
|
||||
# var shield_perp = Vector2(shield_normal.y,-shield_normal.x)
|
||||
# if area.has_method("bounce"):
|
||||
# if projectile_velocity.dot(shield_perp) < 0:
|
||||
# area.bounce(shield_normal)
|
||||
if area.has_method("bounce"):
|
||||
#if projectile_velocity.dot(shield_normal) < 0:
|
||||
area.bounce(shield_normal)
|
||||
Reference in New Issue
Block a user