Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
886c239
Create intialstatement.md
Kovenwei Mar 22, 2016
acc61ab
Rename intialstatement.md to initialstatement.md
Kovenwei Mar 22, 2016
052c80b
Update initialstatement.md
Kovenwei Mar 22, 2016
ee03afa
Create initialprojectstatement.md
johnswanson3 Mar 22, 2016
efe27ea
Testing
Kovenwei Jun 14, 2016
e7d0b55
Create PCP
johnswanson3 Jun 14, 2016
d5cbd93
Delete PCP
johnswanson3 Jun 14, 2016
fd0f9c6
Create PCP.py
johnswanson3 Jun 14, 2016
79e3c46
Merge pull request #1 from Kovenwei/Koven-Wei
Kovenwei Jun 14, 2016
a4c3acb
Delete Koven's Part.py
Kovenwei Jun 14, 2016
f388188
created file
Kovenwei Jun 14, 2016
82b13c8
Delete mixtape_jump.py
Kovenwei Jun 14, 2016
310981e
File Creation
Kovenwei Jun 14, 2016
ee7f51f
Merge remote-tracking branch 'origin/master'
Kovenwei Jun 14, 2016
95cde66
Delete test.py
Kovenwei Jun 14, 2016
8cbc569
Merge pull request #2 from johnswanson3/John
Kovenwei Jun 14, 2016
a8b9434
Delete PCP.py
Kovenwei Jun 14, 2016
2ebd572
testing
Kovenwei Jun 14, 2016
6b3e321
Merge remote-tracking branch 'origin/Koven-Wei' into Koven-Wei
Kovenwei Jun 14, 2016
d885491
testing
Kovenwei Jun 14, 2016
1ed90d6
testing
Kovenwei Jun 14, 2016
c355b09
test1
johnswanson3 Jun 15, 2016
cbf82e1
Create initialprojectstatement.md
johnswanson3 Mar 22, 2016
37f8dc1
Create PCP
johnswanson3 Jun 14, 2016
6f8fd47
Delete PCP
johnswanson3 Jun 14, 2016
92839e9
Create PCP.py
johnswanson3 Jun 14, 2016
2975f10
File Creation
Kovenwei Jun 14, 2016
40be644
Delete test.py
Kovenwei Jun 14, 2016
ec2a506
Delete PCP.py
Kovenwei Jun 14, 2016
9c53f56
Merge pull request #3 from Kovenwei/John
Kovenwei Jun 15, 2016
84dd262
test2
johnswanson3 Jun 15, 2016
726f2db
OKOKOKOKO
Kovenwei Jun 15, 2016
1e8a3da
Merge pull request #4 from Kovenwei/John
Kovenwei Jun 15, 2016
0751808
Merge branch 'master' into Koven-Wei
Kovenwei Jun 15, 2016
04aec1f
Merge branch 'Koven-Wei'
Kovenwei Jun 15, 2016
10537e8
Test1
YutaroM Jun 15, 2016
a565c56
Merge remote-tracking branch 'origin/master'
Kovenwei Jun 15, 2016
1cc86df
class widgetdrawer
YutaroM Jun 15, 2016
c086404
Added imports
Kovenwei Jun 15, 2016
fdcc17b
Merge remote-tracking branch 'remotes/origin/master' into Koven-Wei
Kovenwei Jun 15, 2016
71d3467
Merge remote-tracking branch 'remotes/origin/master' into Koven-Wei
Kovenwei Jun 15, 2016
327afed
Created widgetdrawer class, initialized, determined size of widget
YutaroM Jun 15, 2016
cfd37d1
Created class GUI(widget)
Kovenwei Jun 15, 2016
2f28a4f
Merge remote-tracking branch 'remotes/origin/master' into Koven-Wei
Kovenwei Jun 15, 2016
0c4e729
created clas widgetdrawer, initialized widget sizes and movement, cen…
YutaroM Jun 15, 2016
6904c1a
Created check score function
Kovenwei Jun 15, 2016
b33a0d3
Merge remote-tracking branch 'remotes/origin/master' into Koven-Wei
Kovenwei Jun 15, 2016
538cb9b
acidentally added yutaro's
Kovenwei Jun 15, 2016
e9a45e5
fixed self placement
Kovenwei Jun 15, 2016
df048f1
Created next function add rapper and fixed def check_score placement
Kovenwei Jun 15, 2016
e382b7c
Created function addrapper(self)
Kovenwei Jun 15, 2016
26f2052
Merge branch 'Koven-Wei'
Kovenwei Jun 15, 2016
edffe3f
Created function on_touch_down(self,touch)
Kovenwei Jun 15, 2016
862ad67
Added a few docstrings
Kovenwei Jun 15, 2016
a9aa1fc
Added a few docstrings
Kovenwei Jun 15, 2016
2a63e3d
Merge branch 'Koven-Wei'
Kovenwei Jun 15, 2016
16b3a0b
Added function update(self,dt)
Kovenwei Jun 15, 2016
10896df
Added function update(self,dt)
Kovenwei Jun 15, 2016
cfc59a2
Merge remote-tracking branch 'remotes/origin/master' into Koven-Wei
Kovenwei Jun 15, 2016
769c149
Created class ClientApp(App)
Kovenwei Jun 15, 2016
afdb25b
Created class ClientApp(App)
Kovenwei Jun 15, 2016
e2d0745
Merge branch 'Koven-Wei'
Kovenwei Jun 15, 2016
024df64
fixing merging error
Kovenwei Jun 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions initialprojectstatement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Initial Project Statement

## Objective
Simple 2D side-scrolling platformer with various obstacles such as bots and terrain using unity and c#

## Motivations
Our motivation comes from the simplicity a platformer gives as well as the side scrolling possibility that gives a platform its unique appearance. We chose to create a platformer because it is one of the main genres of gaming which dwells on the curiosity we had in our childhood on the gameplay and now with our developing abilities with code, we can further our understanding of games and break the creation down to our understanding.

## Languages
C# and Unity

## Technology
We plan on using monodevelop or visual studio for coding in c#
to design the game we will use unity.

## Benefits
How will you benefit from this project?
We will learn to code in c# and further develop our passion for computer science and game programing. Hopefully, this project will open our minds to the various applications for computer science in our daily and professional lives.

## Foreseeable Challenges
- Learning a new programming language
- Artwork for the game
- Debugging the game
- Creating the basic foundation of its functionality
- Time management



## High-Level Learning & Action Outline
* Brainstorm application functionality - 1 Week
* Learn C# and Unity - 5 Weeks
* Application Mock-Ups - 1 Week
* Development - 6 Weeks
* Testing & Fixing - 1 Week
* Documentation - 1 Week
39 changes: 39 additions & 0 deletions initialstatement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Initial Project Statement

## Objective
Simple 2D side-scrolling platformer with various obstacles such as bots and terrain using unity and c#

## Motivations
Our motivation comes from the simplicity a platformer gives as well as the side scrolling possibility that gives a platform its unique appearance. We chose to create a platformer because it is one of the main genres of gaming which dwells on the curiosity we had in our childhood on the gameplay and now with our developing abilities with code, we can further our understanding of games and break the creation down to our understanding.

## Languages
C# and Unity

## Technology
We plan on using monodevelop or visual studio for coding in c#
to design the game we will use unity.

## Benefits
How will you benefit from this project?
We will learn to code in c# and further develop our passion for computer science and game programing. Hopefully, this project will open our minds to the various applications for computer science in our daily and professional lives.

## Foreseeable Challenges
- Learning a new programming language
- Artwork for the game
- Debugging the game
- Creating the basic foundation of its functionality
- Time management

## High-Level Learning & Action Outline
* Brainstorm application functionality - 1 Week
* Learn C# and Unity - 5 Weeks
* Application Mock-Ups - 1 Week
* Development - 6 Weeks
* Testing & Fixing - 1 Week
* Documentation - 1 Week

##Members
- Koven Wei
- John Han
- Yutaro Miyata
- Matthew Hope
212 changes: 212 additions & 0 deletions mixtape_jump.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
import kivy
kivy.require('1.7.2')
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.core.window import Window
from kivy.properties import NumericProperty
from kivy.clock import Clock
from kivy.graphics import Rectangle, Color, Canvas
from random import *

class GUI(Widget):
rapperList =[]
rapperScore = NumericProperty(0)
minProb = 1780
def __init__(self, **kwargs):
super(GUI, self).__init__(**kwargs)
self.score = Label(text = "0")
self.score.y = Window.height*0.8
self.score.x = Window.width*0.2
self.rapperScore = 0
l = Label(text='Mixtape Jump')
l.x = Window.width/2 - l.width/2
l.y = Window.height*0.8
self.add_widget(l)
self.mixtape = mixtape(imageStr = 'C:\Users\Koven\desktop\photoshopped\mmixtape.png')
self.mixtape.x = Window.width/4
self.mixtape.y = Window.height/2
self.add_widget(self.mixtape)

def check_score(self,obj):
self.score.text = str(self.rapperScore)
self.bind(rapperScore = check_score)
self.add_widget(self.score)

def addrapper(self):
"""
Program to initialize the opposing objects and the multiple rapper heads which includes its randomized placement
and the velocity which it moves at
:return:
"""
#add an rapper to the screen
#initialize its image
imageNumber = randint(1,7)
imageStr = ('C:\Users\Koven\desktop\photoshopped\image'+str(imageNumber)+'.png')
tmprapper = rapper(imageStr)
tmprapper.x = Window.width*0.99
#randomize y position
ypos = randint(2,25)
ypos = ypos*Window.height*.0625
#moves only on the x-axis
tmprapper.y = ypos
tmprapper.velocity_y = 0
vel = 10
tmprapper.velocity_x = -0.1*vel
#adds list to another rapper list which helps append score
self.rapperList.append(tmprapper)
self.add_widget(tmprapper)
#handle input events
def on_touch_down(self, touch):
"""
Program to move the mixtape up according to when the screen is pressed
:param touch: none (when it is pressed down (responsive to touch events))
:return:
"""
#moves the mixtape up
self.mixtape.impulse = 3
#Gravitational velocity to help move down
self.mixtape.grav = -0.1

def gameOver(self):
"""
Program to initiate when the game is over from collision as well as the initialization of restart
:return:
"""
# this function is called when the game ends
#add a restart button
restartButton = MyButton(text='Press to Restart, your score was ' + str(self.rapperScore))
def restart_button(obj):
#this function will be called whenever the reset button is pushed
print 'restart button pushed'
#reset game
for k in self.rapperList:
self.remove_widget(k)
self.mixtape.xpos = Window.width*0.25
self.mixtape.ypos = Window.height*0.5
self.minProb = 1780
self.rapperList = []

self.parent.remove_widget(restartButton)
#stop the game clock in case it hasn't already been stopped
Clock.unschedule(self.update)
#start the game clock
Clock.schedule_interval(self.update, 1.0/60.0)
restartButton.size = (Window.width*.3,Window.width*.1)
restartButton.pos = Window.width*0.5-restartButton.width/2, Window.height*0.5
#bind the button using the built-in on_release event
#whenever the button is released, the restart_button function is called
restartButton.bind(on_release=restart_button)

#It's important that the parent gets the button so you can click on it
#otherwise you can't click through the main game's canvas
self.parent.add_widget(restartButton)

def gameOver(self):
"""
Program to initiate when the game is over from collision as well as the initialization of restart
:return:
"""
# this function is called when the game ends
#add a restart button
restartButton = MyButton(text='Press to Restart, your score was ' + str(self.rapperScore))
def restart_button(obj):
#this function will be called whenever the reset button is pushed
print 'restart button pushed'
#reset game
for k in self.rapperList:
self.remove_widget(k)
self.mixtape.xpos = Window.width*0.25
self.mixtape.ypos = Window.height*0.5
self.minProb = 1780
self.rapperList = []

self.parent.remove_widget(restartButton)
#stop the game clock in case it hasn't already been stopped
Clock.unschedule(self.update)
#start the game clock
Clock.schedule_interval(self.update, 1.0/60.0)
restartButton.size = (Window.width*.3,Window.width*.1)
restartButton.pos = Window.width*0.5-restartButton.width/2, Window.height*0.5
#bind the button using the built-in on_release event
#whenever the button is released, the restart_button function is called
restartButton.bind(on_release=restart_button)

#It's important that the parent gets the button so you can click on it
#otherwise you can't click through the main game's canvas
self.parent.add_widget(restartButton)

def update(self,dt):
"""
Program to update when the add to score as well as when to spawn a rapper, end the game
:param dt: none (clock object (time elapsed))
:return:
"""
#This update function is the main update function for the game
#events are setup here as well
#update game objects
#update mixtape
self.mixtape.update()
#update rappers
#randomly add an rapper
tmpCount = randint(1,1800)
print self.minProb
#overtime difficulty increase
if tmpCount > self.minProb:
self.addrapper()
self.minProb = self.minProb - 0.10
#peak difficulty
if self.minProb <= 1750:
self.minProb = self.minProb + 0.1
if self.mixtape.y < Window.height * 0.001:
self.mixtape.impulse = 10
for k in self.rapperList:
#check for collision with mixtape
if k.collide_widget(self.mixtape):
print 'death'
#game over routine
self.gameOver()
Clock.unschedule(self.update)
self.rapperScore = 0
#when rappers past the left screen
if k.x < -100:
self.remove_widget(k)
self.rapperScore += 1
tmpRapperList = self.rapperList
tmpRapperList[:] = [x for x in tmpRapperList if (x.x > - 100)]
self.RapperList = tmpRapperList
k.update()


class ClientApp(App):
"""
An Client App Object
"""
def build(self):
"""
Program to initialize the buttons and start the game and game clock
:return: none (return the GUI Class)
"""
#widget initializations and insertion
#used to initialize buttons
parent = Widget()
app = GUI()
#Start the game clock (runs update function once every (1/60) seconds)
Clock.schedule_interval(app.update, 1.0/60.0)
parent.add_widget(app)
return parent

if __name__ == '__main__' :
ClientApp().run()