Added Garden Drop game.

This commit is contained in:
Loudrob 2015-03-06 16:24:29 -05:00
parent c76dcab057
commit 5d445f8a15
7 changed files with 700 additions and 467 deletions

1
save.dat Normal file
View file

@ -0,0 +1 @@


View file

@ -74,6 +74,7 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.loadFlowerSellBox() self.loadFlowerSellBox()
self.oldClear = base.win.getClearColor() self.oldClear = base.win.getClearColor()
base.win.setClearColor(Vec4(0.09, 0.55, 0.21, 1.0)) base.win.setClearColor(Vec4(0.09, 0.55, 0.21, 1.0))
self.startGame()
def unload(self): def unload(self):
self.ignoreAll() self.ignoreAll()
@ -100,6 +101,7 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.flowerSellBox.removeNode() self.flowerSellBox.removeNode()
del self.flowerSellBox del self.flowerSellBox
self.flowerSellBox = None self.flowerSellBox = None
GardenDropGame.GardenDropGame().endGame()
return return
def announceGenerate(self): def announceGenerate(self):
@ -107,7 +109,7 @@ class DistributedEstate(DistributedObject.DistributedObject):
self.accept('gardenGame', self.startGame) self.accept('gardenGame', self.startGame)
def startGame(self): def startGame(self):
self.game = GardenDropGame.GardenDropGame() self.game = GardenDropGame.GardenDropGame().playGardenDrop()
def loadAirplane(self): def loadAirplane(self):
self.airplane = loader.loadModel('phase_4/models/props/airplane.bam') self.airplane = loader.loadModel('phase_4/models/props/airplane.bam')

View file

@ -34,8 +34,8 @@ class DistributedFurnitureManager(DistributedObject.DistributedObject):
if self.ownerId == base.localAvatar.doId: if self.ownerId == base.localAvatar.doId:
self.cr.furnitureManager = self self.cr.furnitureManager = self
if self.cr.objectManager == None: if self.cr.objectManager == None:
import HouseDesign import houseDesign
self.cr.objectManager = HouseDesign.ObjectManager() self.cr.objectManager = houseDesign.ObjectManager()
return return
def setOwnerName(self, name): def setOwnerName(self, name):

View file

@ -1,14 +1,30 @@
########################## TOONTOWN ADVENTURE ##########################
# Filename: GameSprite.py
# Created by: sillypeppymacspeed
# Date: March 28th, 2014
####
# Description:
#
# This codes the sprites for the Garden Drop estate game.
####
### DEFINITELY NOT COPIED FROM TOONTOWN HOUSE
import math import math
class GameSprite: class GameSprite:
colorRed = (1, 0, 0, 1) colorRed = (1, 0, 0, 1)
colorBlue = (0, 0, 1, 1) colorBlue = (0, 0, 1, 1)
colorGreen = (0, 1, 0, 1) colorGreen = (0, 1, 0, 1)
colorYellow = (1, 1, 0, 1)
colorPurple = (1, 0, 1, 1)
colorGhostRed = (1, 0, 0, 0.5) colorGhostRed = (1, 0, 0, 0.5)
colorGhostBlue = (0, 0, 1, 0.5) colorGhostBlue = (0, 0, 1, 0.5)
colorGhostGreen = (0, 1, 0, 0.5) colorGhostGreen = (0, 1, 0, 0.5)
colorGhostYellow = (1, 1, 0, 0.5)
colorGhostPurple = (1, 0, 1, 0.5)
colorWhite = (1, 1, 1, 1) colorWhite = (1, 1, 1, 1)
colorBlack = (0, 0, 0, 1.0) colorBlack = (0.5, 0.5, 0.5, 1.0)
colorShadow = (0, 0, 0, 0.5) colorShadow = (0, 0, 0, 0.5)
def __init__(self, nodeObj, colorType = 0, foundation = 0): def __init__(self, nodeObj, colorType = 0, foundation = 0):
@ -29,12 +45,20 @@ class GameSprite:
self.setColor(GameSprite.colorGhostBlue) self.setColor(GameSprite.colorGhostBlue)
elif colorType == 2: elif colorType == 2:
self.setColor(GameSprite.colorGhostGreen) self.setColor(GameSprite.colorGhostGreen)
elif colorType == 3:
self.setColor(GameSprite.colorGhostYellow)
elif colorType == 4:
self.setColor(GameSprite.colorGhostPurple)
elif colorType == 0: elif colorType == 0:
self.setColor(GameSprite.colorRed) self.setColor(GameSprite.colorRed)
elif colorType == 1: elif colorType == 1:
self.setColor(GameSprite.colorBlue) self.setColor(GameSprite.colorBlue)
elif colorType == 2: elif colorType == 2:
self.setColor(GameSprite.colorGreen) self.setColor(GameSprite.colorGreen)
elif colorType == 3:
self.setColor(GameSprite.colorYellow)
elif colorType == 4:
self.setColor(GameSprite.colorPurple)
self.markedForDeath = 0 self.markedForDeath = 0
def delete(self): def delete(self):

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,36 @@
acceptErrorDialog = 0
doneEvent = 'game Done'
colorRed = (1, 0, 0, 1)
colorBlue = (0, 0, 1, 1)
colorGreen = (0, 1, 0, 1)
colorGhostRed = (1, 0, 0, 0.5)
colorGhostGreen = (0, 1, 0, 0.5)
colorWhite = (1, 1, 1, 1)
colorBlack = (0.5, 0.5, 0.5, 1.0)
colorShadow = (0, 0, 0, 0.5)
running = 0
maxX = 0.46999999999999997
minX = -0.46999999999999997
maxZ = 0.75000000000000002
minZ = -0.00000000000000001
newBallX = 0.0
newBallZ = 0.69999999999999998
rangeX = (maxX - minX)
rangeZ = (maxZ - minZ)
size = 0.085000000000000006
sizeZ = (size * 0.80000000000000004)
gX = int((rangeX / size))
gZ = int((rangeZ / sizeZ))
maxX = (minX + (gX * size))
maxZ = (minZ + (gZ * sizeZ))
controlOffsetX = 0.0
controlOffsetZ = 0.0
queExtent = 3
gridDimX = gX
gridDimZ = gZ
gridBrick = False
newBallTime = 1.0
newBallCountUp = 0.0
cogX = 0
cogZ = 0
controlSprite = None

View file

@ -9609,6 +9609,16 @@ CheckersObserver = 'You are Observing'
RegularCheckers = 'Checkers.' RegularCheckers = 'Checkers.'
RegularCheckersGameOf = ' has just won a game of ' RegularCheckersGameOf = ' has just won a game of '
RegularCheckersYouWon = 'You just won a game of Checkers!' RegularCheckersYouWon = 'You just won a game of Checkers!'
GardenDropTitle = 'Garden Drop'
GardenDropExitGame = 'Exit Mini Game'
GardenDropHelpTitle = 'Instructions:'
GardenDropInstructions = "Match the ghost balls with the normal balls! But beware of the cog ball, it will try to block you off!"
GardenDropBackToGame = "Back to Game"
GardenDropButtonTitle = 'Garden\nDrop'
GardenDropCongradulations = 'Super Congratulations!!'
GardenDropProgressLevels = "Click 'Next' to go to the next level!"
GardenDropWinGame = 'You have won the Garden Drop Game!'
GardenDropExit = 'Exit'
MailNotifyNewItems = "You've got mail!" MailNotifyNewItems = "You've got mail!"
MailNewMailButton = 'Mail' MailNewMailButton = 'Mail'
MailSimpleMail = 'Note' MailSimpleMail = 'Note'