Skip to content

Commit

Permalink
Merge pull request #48 from Chateauvisionn/dev
Browse files Browse the repository at this point in the history
Updated multiplayer.py and changed inventory access
  • Loading branch information
Evhann authored May 1, 2022
2 parents d9157c1 + 9e38c8f commit de400d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 15 additions & 4 deletions vitrix/lib/entities/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
from ursina.prefabs.first_person_controller import FirstPersonController

from lib.entities.bullet import Bullet
from lib.paths import GamePaths
from lib.weapons.hammer import Hammer
from lib.weapons.pistol import Pistol
from lib.weapons.sword import Sword
from lib.weapons.battleaxe import BattleAxe
# from lib.UI.inventory import inventory

from lib.items.aid_kit import AidKit

Expand Down Expand Up @@ -89,6 +91,10 @@ def __init__(self, position: ursina.Vec3):
self.shots_left = 5
self.death_message_shown = False

self.lock = False
# self._inventory = None
# self.inventory_opened = False

def hide_reload_warning(self):
time.sleep(1)
self.reload_warning_text.disable()
Expand Down Expand Up @@ -146,13 +152,18 @@ def input(self, key):
# Inventory key access

#if key == 'i':
# inventory()
# if not self.inventory_opened:
# _inventory = inventory()
# inventory_opened = True
# else:
# _inventory = None
# inventory_opened = False
#
# if lock == False:
# lock = True
# if self.lock == False:
# self.lock = True
# self.on_enable()
# else:
# lock = False
# self.lock = False
# self.on_disable()

if key == "left mouse down" and self.health > 0:
Expand Down
4 changes: 3 additions & 1 deletion vitrix/multiplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import socket
import threading
import ursina
from ursina.shaders.basic_lighting_shader import basic_lighting_shader

from lib.UI.notification import notify
from lib.classes.network import Network
Expand Down Expand Up @@ -83,10 +84,11 @@
map = Map()
sky = ursina.Entity(
model="sphere",
texture=os.path.join("assets", "sky.png"),
texture=os.path.join("assets", "textures", "sky.png"),
scale=9999,
double_sided=True
)
ursina.Entity.default_shader = basic_lighting_shader

player = Player(ursina.Vec3(0, 1, 0))

Expand Down

0 comments on commit de400d6

Please sign in to comment.