Skip to content

Commit

Permalink
Merge pull request #3 from RobzLegz/new-map
Browse files Browse the repository at this point in the history
New map
  • Loading branch information
RobzLegz authored May 19, 2022
2 parents 938be74 + 53ddf3c commit 93283ff
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,27 @@
viz.mouse.setVisible(True)

# Load piazza environment
piazza = viz.addChild('piazza.osgb')
viz.addChild('piazza_animations.osgb')

# Swap out sky with animated sky dome
piazza.getChild('pz_skydome').remove()
day = viz.add('sky_day.osgb')

# Add avatar sitting on a bench
male = viz.addAvatar('vcc_male2.cfg',pos=(-6.5,0,13.5),euler=(90,0,0))
male.state(6)
piazza = viz.addChild('CityPark.osgb')
# viz.addChild('piazza_animations.osgb')

mylight = viz.addLight()

#Set the light parameters
mylight.position(0,10,0)
mylight.direction(0,0,90)
mylight.spread(180)
mylight.intensity(20)
mylight.spotexponent(2)
mylight.setPosition(0,10,0)

mylight2 = viz.addLight()
#Set the light parameters
mylight2.position(0,1000,0)
mylight2.direction(0,0,90)
mylight2.spread(180)
mylight2.intensity(20)
mylight2.spotexponent(2)
mylight2.setPosition(0,1000,0)

#fn for setting game appearance
(flash_quad, status_bar, time_text, score_text, gray_effect, inventory, resultPanel) = set_appearance()
Expand All @@ -62,10 +73,10 @@

bin_object = {}

for i in range(10):
for i in range(13):
#Generate random values for position and orientation
x = random.randint(-10, 10)
z = random.randint(-7, 7)
x = random.randint(-2, 2)
z = random.randint(-5, 19)
yaw = random.randint(0,360)

#Load a trash
Expand All @@ -88,8 +99,10 @@
trash_pile.append(trash)

for i in range(3):
x = i * -2
z = 0
xer = i + 1

x = xer * -2 - 2
z = 3
yaw = random.randint(0, 20)

bin_type = bin_from_index(i)
Expand Down Expand Up @@ -127,7 +140,7 @@ def removeObjects():
recycle_bin.visible(False)

def showResults():
if len(collected_trash) >= 9:
if len(collected_trash) >= 12:
resultPanel.setText(RESULTS)
resultPanel.visible(True)
removeObjects()
Expand All @@ -149,7 +162,7 @@ def DisplayInventory():

inventory.message(PICKED_TRASH.format(item_type))

if len(collected_trash) >= 9:
if len(collected_trash) >= 12:
showResults()

def dropTrash(object):
Expand Down

0 comments on commit 93283ff

Please sign in to comment.