Forgot to save a file
[SpaceyShooter.git] / classes.py
blob39848d91c4f0ed0a241eed1592d77a06e9968889
1 #All angles are in radians
3 Class ObjectModel:
4 """The model data for physical and non-physical objects"""
5 VertsList = []
6 Faces = [] #Assumes all triangles!
8 class PhysicalEntity:
9 """Entities able to effect other entities"""
10 VelXYR = [0.0, 0.0, 0.0]
11 PosXYR = [0.0, 0.0, 0.0]
12 RotXYZ = [0.0, 0.0, 0.0]
13 Health = 100
14 Model = None #Expects ObjectModel type
16 def render(self):
17 pass
20 class ShipEntity:
21 """Entities able to thrust and must always remain oriented tangent with the sphere"""
22 #RotXYZ = tan2sphere(PosXYR)
24 class Zippis:
25 PosXYZ = [0.0, 0.0, 0.0]
26 Intensity = 1
28 class GameSphere:
29 """The sphere of which all physical objects are located"""
30 Radius = 0.0
31 ObjList = []
32 Model = None
34 class BonusItem(PhysicalEntity):
35 """Bonus Items that happen to be floating around"""
36 DegradeTime = 20
37 DegradesTo = None
39 def Activate(self, player):
40 """Do some function to the player"""
41 self.Destroy()
42 pass
43 def Degrade(self):
44 """Degrade into lesser bonus object"""
45 pass
46 def Destroy(self):
47 """Remove bonus item from the game"""
48 pass
50 class BonusPoints(BonusItem):
51 Value = 0
52 def Activate(self, player):
53 player.Score += Value
54 self.Destroy()
56 class BonusLife(BonusItem):
57 def Activate(self, player):
58 player.Lives += 1
59 self.Destroy()
61 class BonusShield(BonusItem):
62 def Activate(self, player):
63 player.ship.Shield = True
64 self.Destroy()
66 class PlayerShip(ShipEntity):
67 """Player's Ship"""
68 NumBombs = 0
69 NumBoost = 0
70 Shield = False
71 Weapons = [] #list of three weapon classes
74 class Player:
75 """Actual player data"""
76 Ship = None
77 Score = 0
78 Lives = 0
79 Multi = 1
81 class Universe:
82 Planet = None
83 Stars = [] #List of Zippis
84 NebulaImg = None
85 MiscJunk = []