Upload
jennifer-villacis
View
98
Download
0
Embed Size (px)
Citation preview
Games in JavaDepartment of Computer Science
Professor Yi Chen
HappyKimJennifer Villacis
Elisabeth DomondJose Munoz-Lopez
PongJesus GonzalezJames Laskey
FrustrationErwin Aguilar
Reuben Orihuela
Basic Introduction to Java• Class= a functioning part of a project• Method= a command• Variable = name for an object• Line (X1,Y1,X2,Y2, canvas);• FramedRect (x, y, width, height, canvas)• FilledRect• FramedOval/FilledOval• Text
• Set Size• Set Font• Set Color
• Oval1.setColor(Color.ORANGE)• Public void begin (): Starts effects once
canvas is opened. Other options include:• onMouseClick• onMousePress/onMouseRelease• onMouseEnter/onMouseExit• onMouseDrag
Sample Exercises
Pong
PongWhy?Pong is one of the first classic games to achieve mainstream popularity.The coding of Pong is a fun and enjoyable experience!Design:Pong: The skeleton of the game, it displays the frame and controls the paddles.MovingPongBall: Controls the movement of the pong ball.
Challenges:1.It was difficult to code for the ball to stay within the boundaries and bounce off the paddles.2.Controlling the direction of the ball and where it would head towards.3.Having the top paddle be controlled by the mouse keys.4.Finalizing the game and making sure it runs smoothly without lag.
Frustration
FrustrationWhy? • The purpose of our game is to frustrate
people as much as possible.Design: Frustration controller(contains methods)Falling tile (contains object animations)Challenges: • Making the original idea a reality • Coding in the correct order
HappyKimWhy?• It is a very well known game, so we
thought it would be fun to recreate it. • We thought it would be simple to
work with and to add our own designs and animations.
Design:Classes:
Controller-contains all the methodsBird- used to control falling ball animationTubes- used to create the tubesTubes Controller- used to control the motion of the tubes
Challenges:• It was difficult to program the “bird”
falling object to jump at specific shifts.
• In addition, it was difficult to program the motion of the tubes and to generate random tube heights.
ConclusionWe would like to give a special Thank You to:
Sergio Marin
Dr. Maria Tucker
Professor Chen
Dunmi Alabi