diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/initialprojectstatement.md b/initialprojectstatement.md new file mode 100644 index 0000000..8dcb172 --- /dev/null +++ b/initialprojectstatement.md @@ -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 diff --git a/initialstatement.md b/initialstatement.md new file mode 100644 index 0000000..c32bec3 --- /dev/null +++ b/initialstatement.md @@ -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 diff --git a/mixtape_jump.py b/mixtape_jump.py new file mode 100644 index 0000000..da580d6 --- /dev/null +++ b/mixtape_jump.py @@ -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() + + + + + + + + + + +