forked from ZippyCodeYT/Zippy_Codes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsquidGame5thLevel.py
122 lines (67 loc) · 1.38 KB
/
squidGame5thLevel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from ursina import *
from ursina.prefabs.first_person_controller \
import FirstPersonController
app = Ursina()
window.fullscreen =True
window.color=color.black
player = FirstPersonController(
collider='box',jump_duration=0.35
)
player.cursor.visible=False
ground = Entity(
model='plane',
texture='grass',
collider='mesh',
scale=(30,0,3)
)
pill1 = Entity(
model='cube',
color=color.violet,
scale=(0.4,0.1,53),
z=28,x=-0.7
)
pill2 = duplicate(pill1,
x=-3.7)
pill3 = duplicate(pill1,
x=0.6)
pill4 = duplicate(pill1,
x=3.6)
from random import randint
blocks = []
for i in range(12):
block = Entity(
model='cube',collider='box',
color = color.white33,
position=(2,0.1,3+i*4),
scale=(3,0.1,2.5)
)
block2 = duplicate(block,
x=-2.2)
blocks.append(
(block,block2,randint(0,10)>7,
randint(0,10)>7)
)
goal = Entity(
color=color.brown,
model='cube',
z=55,
scale=(10,1,10),
)
pillar = Entity(
color=color.brown,
model='cube',
z=58,
scale=(1,15,1),y=8
)
def update():
for block1,block2,k,n in blocks:
for x,y in [(block1,k),
(block2,n)]:
if x.intersects() and y:
invoke(destroy,x,
delay=0.1)
x.fade_out(duration=0.1)
def input(key):
if key =='q':
quit()
app.run()