-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpolePositionRunner.py
71 lines (51 loc) · 1.9 KB
/
polePositionRunner.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
'''
===============================================================================
ENGR 133 Fa 2020
Assignment Information
Assignment: Final Project
Author: Alec Pannunzio, afpannun@purdue.edu
Team ID: LC4-5
===============================================================================
'''
from game_engine.ObjectDraw import ObjectDraw
from game_engine.RelativeSprite import RelativeSprite
from game_engine.Sprite import Sprite
import Playercar
import Computercar
import Racetrack
from math import sin,cos,pi
import pygame
import time
import threading
# runs the necessary functions and classes to run pole position
objectDraw = ObjectDraw(1000,800); #create objectDraw
useFirstPerson = input("Do you want to use first person mode? yes(y) or no(n)");
useFirstPerson = useFirstPerson.lower();
# if the user's answer starts with "y" then use first person
firstPerson = (useFirstPerson[0] == "y")
racecar = Playercar.Playercar(objectDraw,firstPerson); # create the playercar
cpu = Computercar.Computercar(objectDraw,firstPerson,racecar); # create the cpu
racetrack = Racetrack.Racetrack(objectDraw,racecar,firstPerson); # create the racetrack
cpu.setRacetrack(racetrack);
'''
add to objectdraw
'''
objectDraw.add(racetrack);
objectDraw.add(cpu);
objectDraw.add(racecar);
#set the background color
objectDraw.setBackgroundColor((0,255,0));
#start the game engine
objectDraw.start();
turnAmount = 0;
while(not objectDraw.done):
objectDraw.run(); # run the game engine stuff
'''
===============================================================================
ACADEMIC INTEGRITY STATEMENT
I have not used source code obtained from any other unauthorized
source, either modified or unmodified. Neither have I provided
access to my code to another. The project I am submitting
is my own original work.
===============================================================================
'''