forked from cpena107/Fox-Trail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppState.py
59 lines (45 loc) · 1.49 KB
/
AppState.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
from direct.fsm.FSM import FSM
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.gui.OnscreenImage import OnscreenImage
import sys
from SplitScreenwithController import *
from direct.showbase.ShowBase import ShowBase
class AppState(FSM):
def enterMenu(self):
self.image = OnscreenImage(image="images/startmenu.jpg", pos=(0,0,0), scale=(2.3,2.3,1))
self.intruction = None
self.StartBtn = DirectButton(text = "Start",
scale = 0.12,
pos = Vec3(0, 0, -0.5),
command = self.request,
extraArgs = ["Start"])
self.InstructionsBtn = DirectButton(text = "Instructions",
scale = 0.1,
pos = Vec3(0, 0, -0.65),
command = self.request,
extraArgs = ["Instructions"])
self.QuitBtn = DirectButton(text = "Quit",
scale = 0.1,
pos = Vec3(0,0,-.8),
command = self.request,
extraArgs = ["Quit"])
def exitMenu(self):
self.StartBtn.destroy()
self.InstructionsBtn.destroy()
self.QuitBtn.destroy()
self.image.destroy()
def enterStart(self):
self.game = FoxTrail()
def enterInstructions(self):
self.image = OnscreenImage(image="images/Instructions.jpg", pos=(0,0,0), scale=(1.4,1.4,1))
self.menuBtn = DirectButton(text = "Menu",
scale = 0.1,
pos = Vec3(0, 0, -0.8),
command = self.request,
extraArgs = ["Menu"])
def exitInstructions(self):
self.menuBtn.destroy()
self.image.destroy()
def enterQuit(self):
sys.exit()