mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Leo - storage finished2.0
This commit is contained in:
@@ -3,13 +3,14 @@ extends CharacterBody3D
|
||||
#-----------Parameters--------------#
|
||||
var SPEED = 10
|
||||
var movement = Vector3(0,0,0)
|
||||
var collisionLayer = 3
|
||||
var inventory = 0 #1 - full, 0 - empty inventory
|
||||
var resource = 0
|
||||
|
||||
var is_alive = true
|
||||
@onready var is_player1 = true
|
||||
|
||||
enum TYPE {AMMO, GUNPOWDER, FUEL}
|
||||
|
||||
#---------------Methods--------------#
|
||||
|
||||
func _physics_process(delta):
|
||||
@@ -65,6 +66,10 @@ func check_interaction():
|
||||
if body is Module:
|
||||
#Storage interaction
|
||||
if not inventory && body is Storage:
|
||||
body.interact()
|
||||
body.interact(self)
|
||||
elif inventory && not body is Storage:
|
||||
body.interact()
|
||||
body.interact(self)
|
||||
|
||||
func fill_inventory(type):
|
||||
self.inventory = 1
|
||||
self.resource = type
|
||||
|
||||
Reference in New Issue
Block a user