geep: add new gear
This commit is contained in:
parent
3e23bd4841
commit
b1cbbb1312
2 changed files with 116 additions and 0 deletions
34
gears/geep.gd
Normal file
34
gears/geep.gd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
class_name Geep extends "gear.gd"
|
||||
|
||||
func gear_name():
|
||||
return "Geep"
|
||||
func continuous():
|
||||
return false
|
||||
func use_basis():
|
||||
return idle_basis()
|
||||
|
||||
# multiplier of player's speed
|
||||
const speed = 2
|
||||
|
||||
var driver = null
|
||||
var active = false
|
||||
|
||||
func on_use(player):
|
||||
driver = player
|
||||
if active:
|
||||
active = false
|
||||
position = Vector3.ZERO
|
||||
driver.message("You are no longer driving a Geep")
|
||||
return
|
||||
active = true
|
||||
position = Vector3(-driver.get_node("Pivot/Container").position)
|
||||
driver.message("You are now driving a Geep")
|
||||
|
||||
func on_unequip(player):
|
||||
active = false
|
||||
|
||||
func _physics_process(_delta):
|
||||
if not active:
|
||||
return
|
||||
|
||||
driver.move_player(0, -speed)
|
||||
Loading…
Add table
Add a link
Reference in a new issue