Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated multiplayer.py and changed inventory access #48

Merged
merged 1 commit into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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