Browse Source

Allow player to see-saw the objective

master
Luna 7 years ago
parent
commit
fc0478e2a8
2 changed files with 93 additions and 51 deletions
  1. +91
    -48
      scenes/world.tscn
  2. +2
    -3
      scripts/player.gd

+ 91
- 48
scenes/world.tscn
File diff suppressed because it is too large
View File


+ 2
- 3
scripts/player.gd View File

@ -21,7 +21,7 @@ var timer = 0
var walk_speed = 3 var walk_speed = 3
var jump_speed = 15 var jump_speed = 15
var weight = 500
var weight = 1
var health = 100 var health = 100
var stamina = 10000 var stamina = 10000
var ray_length = 10 var ray_length = 10
@ -118,8 +118,7 @@ func control_player(delta):
for i in range(get_slide_count()): for i in range(get_slide_count()):
var collision = get_slide_collision(i) var collision = get_slide_collision(i)
if collision.collider.is_in_group("objective"): if collision.collider.is_in_group("objective"):
collision.collider.apply_impulse(Vector3(-5,0,-5), Vector3(0, -weight, 0))
print("collided with the objective!")
collision.collider.apply_impulse(collision.position, Vector3(0, -weight, 0))
func _exit_scene(): func _exit_scene():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)


Loading…
Cancel
Save