Skip to content

Commit e7d8dc5

Browse files
omiZone version 0.2
1 parent 9fbfd4d commit e7d8dc5

File tree

2 files changed

+109
-11
lines changed

2 files changed

+109
-11
lines changed

omizone.py

Lines changed: 108 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,132 @@
11
from ursina import *
22
from ursina.prefabs.first_person_controller import FirstPersonController
3+
from ursina.shaders import basic_lighting_shader
34
import os
45
import time
56
import programs
67
os.system('cls')
78

9+
810
print("You are now leaving omicronOS. Press Shift+Q to close the application.")
911
app = Ursina()
1012

1113
stepper = True
1214

15+
16+
def disableBox():
17+
global boxOne
18+
if boxOne==True:
19+
dragbox.parent=globalpos
20+
temppos.position=globalpos.position
21+
boxOne=False
22+
dragbox.parent=temppos
23+
dragbox.x = player.camera_pivot.x
24+
dragbox.y = 0.4
25+
dragbox.z = player.camera_pivot.z
26+
print(dragbox.position)
27+
print(player.forward)
28+
dragbox.collider='box'
29+
distancemodifier = 0.6
30+
#CHANGE NONE OF THE FOLLOWING 9 LINES OF CODE. I am fully aware it jank as all hell, but this is so the player doesn't get stuck inside the box and frankly I don't want to do any more god damn calculations over this fucking dumbshit box
31+
if player.forward.x > 0:
32+
dragbox.x += player.forward.x + distancemodifier
33+
elif player.forward.x < 0:
34+
dragbox.x += player.forward.x - distancemodifier
35+
36+
if player.forward.z > 0:
37+
dragbox.z += player.forward.z + distancemodifier
38+
elif player.forward.z < 0:
39+
dragbox.z += player.forward.z - distancemodifier
40+
print("BB")
41+
#alright, from here on out you're good to edit what you please.
42+
else:
43+
pass
44+
45+
46+
place = Entity(model='level', collider='mesh', shader=basic_lighting_shader, texture='placetexture', scale=0.02)
47+
place2 = Entity(model='level2', collider='mesh', shader=basic_lighting_shader, texture=place.texture, scale=0.02, position=(0, 10, 0))
1348
player = FirstPersonController()
1449
player.position=(-8, 0.2, 8)
1550
player.cursor.color=(color.black)
1651

17-
def input(key):
18-
if key == 'escape':
19-
app.quit()
20-
2152
def makeText():
2253
global app
2354
global stepper
24-
text = Text('FUCK ME')
2555
stepper=False
26-
app.quit()
56+
quit()
57+
58+
def update():
59+
globalpos.position = player.position
60+
if held_keys['shift']:
61+
player.speed = 10
62+
if not held_keys['shift']:
63+
player.speed = 5
64+
65+
if player.y > 20:
66+
player.y = 0
67+
68+
if player.y < -10:
69+
player.y = 0
70+
71+
if held_keys['right mouse']:
72+
disableBox()
73+
74+
75+
76+
boxOne = False
77+
78+
def startVideo():
79+
global lobbytvscreen
80+
global vid
81+
hearing = Audio('ham.mp3')
82+
lobbytvscreen.color=color.white
83+
lobbytvscreen.texture=vid
84+
hearing.play()
85+
86+
def travelPortalToFirst():
87+
player.y = -0.3
88+
89+
def travelPortalToSecond():
90+
player.y = 9
91+
player.z = 7
92+
93+
def enableBoxText():
94+
global boxtext
95+
boxtext = Text("Left Click to Pick Up")
96+
97+
def disableBoxText():
98+
global boxtext
99+
destroy(boxtext)
100+
101+
def enableBox():
102+
global boxOne
103+
if boxOne==False:
104+
dragbox.parent=camera
105+
dragbox.x = 1
106+
dragbox.y = -0.5
107+
dragbox.z = 0.5
108+
print("AA")
109+
boxOne=True
110+
dragbox.collider='none'
111+
else:
112+
pass
27113

28-
place = Entity(model='level', collider='mesh', texture='greyasphalt', scale=0.02, texture_scale=(2, 2))
29-
cube = Entity(model='cube', collider='box', scale=2, on_click=makeText, texture='grass')
114+
vid = 'smokedham.mp4'
115+
globalpos = Entity(position=(0,0,0), rotation=(0,0,0))
116+
temppos = Entity(position=(0,0,0), rotation=(0,0,0))
117+
button = Entity(model='leavebutton', collider='mesh', scale=0.5, on_click=makeText, texture='leavebutton', rotation=(90,0,90), position=(0, 0, 0))
118+
poster = Entity(model='cube', collider='box', texture='controls', position=(-15.1,0,12), scale_y=1.3)
119+
dragbox = Entity(model='cube', collider='box', shader=basic_lighting_shader, texture='redconcrete', position=(1,-2,1), on_click=enableBox, on_mouse_enter=enableBoxText, on_mouse_exit=disableBoxText)
120+
couch = Entity(model="couch", color=color.brown, texture='couchtexture', collider='mesh', shader=basic_lighting_shader, scale=0.2, position=(0.8,-2.2,9), rotation=(0, 90, 0))
121+
coffeetable = Entity(model="table", texture='table', collider='mesh', shader=basic_lighting_shader, scale=0.5, position=(2.8,-2.6,9), rotation=(0, 0, 0))
122+
officetable = Entity(model='table', collider='mesh', color=color.brown, shader=basic_lighting_shader, scale=0.5, position=(-13, -2.4, -12))
123+
officemonitor = Entity(model='monitor.obj', collider='mesh', texture='monitor', shader=basic_lighting_shader, position=(-13, -1.2, -12), scale=0.4, rotation=(0, -90, 0))
124+
lobbytvtable = Entity(model="table", texture='table', collider='mesh', shader=basic_lighting_shader, scale=0.5, position=(10,-2.6,9), rotation=(0, 0, 0))
125+
lobbytv = Entity(model="tv", texture='brick', collider='mesh', shader=basic_lighting_shader, scale=0.5, position=(9.5,-1.4,9), rotation=(0, 0, 0))
126+
lobbytvscreen = Entity(model='cube', collider='box', texture=None, color=color.black, position=(9.4,-0.48,9), scale_z=1.8, scale_x=0.1, scale_y=1.2, on_click=startVideo)
127+
portal = Entity(model='portal', texture='portal', collider='mesh', shader=basic_lighting_shader, position=(6, -2.2, 12.8), rotation=(0, 90, 0), on_click=travelPortalToSecond)
128+
portal2 = Entity(model='portal', texture='portal', collider='mesh', shader=basic_lighting_shader, position=(6, 8, 9.7), rotation=(0, 90, 0), on_click=travelPortalToFirst)
30129
camera.clip_plane_far=20
31130

131+
#camera.ui.disable()
32132
app.run()

programs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# -----IMPORTS
22
import time
33
import os
4-
import turtle
5-
import keyboard
64
import subprocess
75

86
# -----FUNCTIONS
@@ -180,7 +178,7 @@ def runprogram():
180178
read()
181179
runprogram()
182180
elif command == "omizone":
183-
subprocess.run(["python", r"C:\Users\alota\OneDrive\Documents\OmicronOS-main\omizone.py"])
181+
subprocess.run(["python", r"omizone.py"])
184182
clear()
185183
runprogram()
186184
elif command == "exit":

0 commit comments

Comments
 (0)