Skip to content

Commit

Permalink
Changed some things
Browse files Browse the repository at this point in the history
  • Loading branch information
axaggg444 committed Sep 8, 2022
1 parent d92fdb6 commit d43b006
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
16 changes: 10 additions & 6 deletions Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ursina.prefabs.first_person_controller import FirstPersonController
from ursina.shaders import lit_with_shadows_shader
from ursina.prefabs.health_bar import HealthBar
from ursina.mesh_importer import ursina_mesh_to_obj
import Classes
import sys
import lib
Expand All @@ -18,6 +19,9 @@
window.icon = "assets/textures/icon.ico"
window.fps_counter.visible = False

#Load the Models and Textures


Entity.default_shader = lit_with_shadows_shader

#The Sky
Expand All @@ -38,11 +42,11 @@
AmbientLight(parent=pivot, y=10, z=3, shadows=True)

#Player Health bar
Bar = HealthBar(bar_color=color.gray,
show_text=True,
max_value=100,
roundness=.07,
x=-.1)
#Bar = HealthBar(bar_color=color.gray,
# show_text=True,
# max_value=100,
# roundness=.07,
# x=-.1)

#Coordinate Counter
CordCounter = Text(text=f"X:{str(round(player.x))} Y:{str(round(player.y))} Z: {str(round(player.z))}", y=.1, x=-.1, color=color.dark_gray)
Expand Down Expand Up @@ -139,4 +143,4 @@ def input(key):
sys.exit(0)

#mainloop
app.run()
app.run()
9 changes: 1 addition & 8 deletions lib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import json
import random
from ursina import *

def ReadFile(file):
Expand All @@ -13,13 +13,6 @@ def WriteFile(file, data):
f.write(data)
f.close()

def Send(Socket, X, Y, Z, Rotation):
Socket.send(json.dumps({"X": X, "Y": Y, "Z": Z, "Rotation": Rotation})).encode("utf-8")

def Receive(Socket):
Json = Socket.recv(1024).encode("utf-8")
json.load(Json)

def Create_save(Name):
Saves = ReadFile("data/Saves.txt")
Savenumber = int(Saves) + 1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ursina=5.0.0
ursina==5.0.0

0 comments on commit d43b006

Please sign in to comment.