LCD_animation_HelenHyungouJo

I made a pacman game animation on LCD screen. I made frame by frame for each moving, but I wish I could use codes (like using mathematics). And also I struggled to make a sound with sound codes(C,C#..).. however, for the other things I had a lot of fun!!

—————————–

VIDEO

PACMAN GAME ANIMATION

—————————–

CODE

#include <SoftwareSerial.h>
SoftwareSerial LCD (6,7); // 6 is RX 7 is TX
int GAME=0;

void setup() {
LCD.begin(9600);
LCD.write(0x0C); // Form Feed – The cursor is moved to position 0 on line 0
// and the entire display is cleared.
// 0x should be in front of hexadecimal when you want to use
// hex number
delay(5);
LCD.write(0x11); // Turn backlight on
LCD.print(” START!”);

delay(1500);
LCD.write(0x0C);
delay(5);

LCD.write(216); //Select the 4th scale (440Hz)

LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D
LCD.write(213);//1/2note
LCD.write(225);//D

LCD.write(214);//1note
LCD.write(221);//A

LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
void circleA(); //void circleA
LCD.write(4); //coins
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);
void packmanA(); //void packman
LCD.print(” “); //spaces before
LCD.write(2); //second customcharacter
LCD.write(4); //coins
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

void packmanB(); //void packman
LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
void circleB();
LCD.write(5);
LCD.write(2);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
LCD.write(5);
LCD.write(5);
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(2);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “); //spaces before
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(2);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
void invader();
LCD.write(6);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(6);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(2);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(6);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(6);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(2);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(6);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(6);
LCD.write(5);
LCD.write(5);
LCD.write(2);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(6);
LCD.write(5);
LCD.write(3);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

LCD.print(” “); //spaces before
LCD.print(” “);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(5);
LCD.write(6);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
LCD.write(4);
delay(1000);

//GAME OVER
LCD.write(0x0C);
delay(5);
LCD.print(” GAME OVER “);
delay(5000);

}

void loop(){
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s