CS Research Poster 2014

1
Erwin Aguilar, Elisabeth Domond, Jesus Gonzalez, James Laskey, Jose Munoz-Lopez, Reuben Orihuela, Jennifer Villacis Advised by Professor Yi Chen (Computer Science) and Dunmi Olabi ’17 (Computer Science) Introduction: Programming Games in Java Pomona College Academy for Youth Success We would like to thank Professor Yi Chen, our amazing research professor and mentor. We would also like to thank Dr. Maria Tucker, Sergio Marin, and the rest of the PAYS staff and students, for their limitless support. Computer games combine animation, sound, and graphics with some kind of task or storyline. Done well, they become addictive (e.g. Candy Crush, Angry Birds, Don't Tap the White Tile, Snake, 2048). But once you have the idea, how hard is it in practice to program a game? In the course of this research experience we first learned fundamentals of programming in Java using the Eclipse IDE and then explored how this knowledge could be used to implement basic versions of computer games such as Pong and Flappy Birds. (www.candycrushsaga.com) What we did: Understanding and writing code Clearly specifying desired behavior Week 1 and 2-Learned basic functions Class= a functioning part of a project Method= a command Variable = name for an object Line (X 1 ,Y 1 ,X 2 ,Y 2 , canvas); FramedRect (x, y, width, height, canvas); if-else statements Weeks 3 and 4 Formed pairs, worked on final project, and prepared oral presentation What it means: The theme of our summer has been focused around the ideas and perspectives of the American Dream. Computer programming has played an immense role in molding perspectives of the American Dream with its contribution of the Internet, the most influential form of media today. The influence of technology in our world and lives has become extremely widespread and through a career in Computer Science, the stereotypical American Dream life with the white picket fence, 3 kids, waffle house, and a remarkable spouse is definitely possible. Whether its satire or advocacy of the American Dream, a schema subconsciously formed by the viewer, it can also be seen as one’s own idea of an American Dream to become a Computer Engineer. Frustration (Erwin and Reuben) Pong (Jesus and James) The Adventures of Happy Kim (Elisabeth, Jose, Jennifer) (www.angrybirds.com) We decided to create the game of Pong in Java eclipse due to pong being one of the first games to be programmed using java script. We began with the idea of recreating “Piano Tiles” or “Don’t Step on the White Tile.” We decided to use the concept of incorporating Falling Objects. We got our inspiration from a Lumosity game where the basic idea is to filter useless information in order to get the answer. Frustration includes a falling ball with a random color as well as five randomized color names “Red, Yellow, Green, Blue, Pink” and each of these words have a random font color. We have voice recordings that say random colors to further distract the players as well as George Michael’s “Careless Whisper”. The player must ignore all of this given information except for the Font Color and choose that in order to get the correct answer for the game. Pressing an incorrect key or being too slow results in losing the game. The hardest part of coding this game would be making this seemingly simple idea into reality; computers are very picky about how people input code and putting code in the wrong order results in several different types of errors. The original name of the game was Flappy Bird, but we decided to call it Happy Kim because we wanted to make the game’s recreation our own. We chose Kim Rojas, a PAYS TA, as our game character because she is a very animated person. The basic objective of the game is to get the falling object to jump through tubes. The difficult part of the game is trying to get Kim’s face to jump just high/low enough to make it through the randomly spaced tubes. 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. At first we tried to get the bird to fall and move to the right at the same time, but then we figured out that it would be easier to just make the bird fall and have the tubes going to the left instead. Flappy Bird was an easy game to play, and the overall design of it looked easy, but as we created it we were faced with a variety of challenges in getting the game to actually work. We also learned to have more patience with this type of science because there were a number of times where we had to redo different codes. In order to bring the game of pong to computer coding we had to program two different java classes, the Pong class and the MovingPongBall class. 1.Pong Class: Responsible for the skeleton of the game, we used this class in order to create the frame of the game by implementing methods such as “new FramedRect” for the basketball court background and “new FilledRect” for the paddles. This class was also responsible for controlling the movement of the paddles with the top controlled by Arrow Keys and the bottom paddle by the mouse itself. 2.MovingPongBall Class: Responsible for controlling the movement of the pong ball. It maintained control of the direction of the ball when bouncing off the paddles with constant use of If-else statements in the code. The direction of the ball was difficult to code as often times the ball would bounce and head off in a random direction. The controls of the paddles were difficult to code due to the language of the java script.

Transcript of CS Research Poster 2014

Page 1: CS Research Poster 2014

Erwin Aguilar, Elisabeth Domond, Jesus Gonzalez, James Laskey, Jose Munoz-Lopez, Reuben Orihuela, Jennifer VillacisAdvised by Professor Yi Chen (Computer Science) and Dunmi Olabi ’17 (Computer Science)

Introduction:

Programming Games in JavaPomona CollegeAcademy forYouthSuccess

We would like to thank Professor Yi Chen, our amazing research professor and mentor. We would also like to thank Dr. Maria Tucker, Sergio Marin, and the rest of the PAYS staff and students, for their limitless support.

Computer games combine animation, sound, and graphics with some kind of task or storyline.Done well, they become addictive (e.g. Candy Crush, Angry Birds, Don't Tap the White Tile, Snake, 2048). But once you have the idea, how hard is it in practice to program a game? In the course of this research experience we first learned fundamentals of programming in Java using the Eclipse IDE and then explored how this knowledge could be used to implement basic versions of computer games such as Pong and Flappy Birds.

(www.candycrushsaga.com)

What we did:Understanding and writing code

Clearly specifying desired behavior

Week 1 and 2-Learned basic functionsClass= a functioning part of a projectMethod= a commandVariable = name for an objectLine (X1,Y1,X2,Y2, canvas);FramedRect (x, y, width, height,

canvas);if-else statements

Weeks 3 and 4Formed pairs, worked on final project,

and prepared oral presentation

What it means:

• The theme of our summer has been focused around the ideas and perspectives of the American Dream. Computer programming has played an immense role in molding perspectives of the American Dream with its contribution of the Internet, the most influential form of media today.

• The influence of technology in our world and lives has become extremely widespread and through a career in Computer Science, the stereotypical American Dream life with the white picket fence, 3 kids, waffle house, and a remarkable spouse is definitely possible.

• Whether its satire or advocacy of the American Dream, a schema subconsciously formed by the viewer, it can also be seen as one’s own idea of an American Dream to become a Computer Engineer.

Frustration (Erwin and Reuben)Pong (Jesus and James) The Adventures of Happy Kim (Elisabeth, Jose, Jennifer)

(www.angrybirds.com)

We decided to create the game of Pong in Java eclipse due to pong being one of the first games to be programmed using java script.

We began with the idea of recreating “Piano Tiles” or “Don’t Step on the White Tile.” We decided to use the concept of incorporating Falling Objects. We got our inspiration from a Lumosity game where the basic idea is to filter useless information in order to get the answer.

Frustration includes a falling ball with a random color as well as five randomized color names “Red, Yellow, Green, Blue, Pink” and each of these words have a random font color. We have voice recordings that say random colors to further distract the players as well as George Michael’s “Careless Whisper”. The player must ignore all of this given information except for the Font Color and choose that in order to get the correct answer for the game. Pressing an incorrect key or being too slow results in losing the game.

The hardest part of coding this game would be making this seemingly simple idea into reality; computers are very picky about how people input code and putting code in the wrong order results in several different types of errors.

The original name of the game was Flappy Bird, but we decided to call it Happy Kim because we wanted to make the game’s recreation our own. We chose Kim Rojas, a PAYS TA, as our game character because she is a very animated person. The basic objective of the game is to get the falling object to jump through tubes. The difficult part of the game is trying to get Kim’s face to jump just high/low enough to make it through the randomly spaced tubes. 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. At first we tried to get the bird to fall and move to the right at the same time, but then we figured out that it would be easier to just make the bird fall and have the tubes going to the left instead.

Flappy Bird was an easy game to play, and the overall design of it looked easy, but as we created it we were faced with a variety of challenges in getting the game to actually work. We also learned to have more patience with this type of science because there were a number of times where we had to redo different codes.

In order to bring the game of pong to computer coding we had to program two different java classes, the Pong class and the MovingPongBall class.1.Pong Class: Responsible for the skeleton of the game, we used this class in order to create the frame of the game by implementing methods such as “new FramedRect” for the basketball court background and “new FilledRect” for the paddles. This class was also responsible for controlling the movement of the paddles with the top controlled by Arrow Keys and the bottom paddle by the mouse itself.2.MovingPongBall Class: Responsible for controlling the movement of the pong ball. It maintained control of the direction of the ball when bouncing off the paddles with constant use of If-else statements in the code.

The direction of the ball was difficult to code as often times the ball would bounce and head off in a random direction. The controls of the paddles were difficult to code due to the language of the java script.