Page 1 of 2

make a pac-man game tutorial

PostPosted: Sun Nov 29, 2009 12:22 am
by krenisis
I know every one remembers wasting coins on pac-man so now i will take you through making a simple version. This should help newbies be able to make a complete simple game.Here some art to get started. Use the graphics i supplied on these pages.

Re: make a pac-man game tutorial

PostPosted: Sun Nov 29, 2009 12:47 am
by krenisis
ok if you want save the art that i supply here as photos to your computer you can use them or make your own art.Lets start programming.
1) go to new game
2)now add actor pac-man
3)add all 4 animations to pac-man
4)now we are going to make pac-man move ...go to events ...click on key down....press the key you want to use to move pac-man..now go down to add action ..select script editor..do this as you input each of pac-mans movements..
MAKE PACMAN MOVE LEFT x=x-8;ChangeAnimation("Event Actor", "pac left", FORWARD);

MAKE PACMAN MOVE RIGHT x=x-8;ChangeAnimation("Event Actor" , "pac right",FORWARD);
MAKE PACMAN MOVE UP y=y-8;ChangeAnimation("Event Actor", "pac up", FORWARD);
MAKE PACMAN MOVE DOWN y=y+8;ChangeAnimation("Event Actor", "pac down", FORWARD);

Re: make a pac-man game tutorial

PostPosted: Sun Nov 29, 2009 1:31 am
by krenisis
ok now add actor walls and add animations sideways and up and down

now we going to make sure pac-man doesnt go through the walls.
1)click on pac-man ...click on events... click on collision .....on any side of actor walls ..click yes on repeat on collision...go to add action....
go to physical response
1
1
0
1
click on immediate action
ok now we half way done

Re: make a pac-man game tutorial

PostPosted: Sun Nov 29, 2009 1:44 am
by krenisis
Ok now add 3 ghost actors i supplied some here or you could add your own.On each ghost actor you do this
1)ok click on ghost actor ....click on events ....click on draw actor ....click on add action ....click on script editor..
2)ok on the script editor go to bottom of screen click on variables/functions go to 2nd column click on..
move to
relative to pac-man actor
avoid wall actor
click on immedate response.

OK now add to actors
1)add dots actor use small yellow dot
2)add score actor now
ok relax this is almost over

Re: make a pac-man game tutorial

PostPosted: Sun Nov 29, 2009 2:11 am
by krenisis
Ok click on pac-man actor go to clone now go to array click as many as u need.
1)now click on score actor go to text
2)now input 0000 as score
3)click on pac-man ...click on events..click on collision...on any side of dots...click on action...go to script editor...and type this..

score.textNumber=score.textNumber+10;

4)now go back to collision ...on any side of dots....click on action....click on destroy actor...in the actor box choose collide actor ..click immediate response..

OK thier you go a pac-man game , for more features like power pellets and eating ghost learn some more coding and you will have it.Any question pm me or any of our fine staff.

Re: make a pac-man game tutorial

PostPosted: Sun Nov 29, 2009 11:12 am
by MrJolteon
I made a pacman game once.

Re: make a pac-man game tutorial

PostPosted: Mon Nov 30, 2009 8:46 am
by DST
try this:
when adding the animations, give them single int names. pac right=0; pac up =1; pac left=2; pac down=3;
then add a global variable called dir;

Then on keydowns, add them like this:
key right
dir=0;

key up
dir=1;

key left
dir=2;

key down
dir=3;

Then in pacman>draw actor:
Code: Select all
char anim[2]="";
sprintf(anim, "%i", dir);
ChangeAnimation("Event Actor", anim, NO_CHANGE);
angle=(dir*90);
directional_velocity=8;

Re: make a pac-man game tutorial

PostPosted: Thu Dec 10, 2009 3:32 am
by krenisis
Thank you DST can any experianced programmer make the power pellets part , because i dont know how to do it without using alot of code. I want to most effient way possible.

Re: make a pac-man game tutorial

PostPosted: Tue Dec 29, 2009 6:54 am
by Scorpion50o1
could you make a collision event on the power pellet that when u collide with it u destroy the event of pac-man dying form collision on ghost and add collision with ghost destroy ghost. Also collision with it change animation of ghost to blue. and collision with it create timer (i dont know 2500 miliseconds) and after the timer create the event collision on pac-man by ghost destroy pac-man and change animation of ghost back to its color. :mrgreen:

Re: make a pac-man game tutorial

PostPosted: Tue Dec 29, 2009 7:16 am
by Bee-Ant
Dont understand what you mean...its confusing

Re: make a pac-man game tutorial

PostPosted: Thu Dec 31, 2009 3:12 am
by Scorpion50o1
* power pellet > collision on any side of power pellet > disable event - pac-man dies from collision on ghost.
* ghost > collsion on power pellet change animation to blue ghost > create timer [power pellet off] > collsion on ghost by pac-man move ghost to box.
* timer up > enable event of collsion on pac-mon destroy pac-man > change animations of ghost to normal.

Re: make a pac-man game tutorial

PostPosted: Fri Jan 01, 2010 6:48 am
by krenisis
can you make a ged. of that s-5001 ... that will be awesome

Re: make a pac-man game tutorial

PostPosted: Fri Jan 08, 2010 3:48 am
by Scorpion50o1
Guess i could just been busy with school. :O

Re: make a pac-man game tutorial

PostPosted: Tue Jul 13, 2010 12:10 pm
by savvy
One thing to add to this is..DONT over complicate things, get your code and sprites sorted out 1st, do it in a planned out way so that u dont miss important bits out.

Re: make a pac-man game tutorial

PostPosted: Fri Oct 15, 2010 7:31 am
by happycrab
i think i figured out how to make pacman die when he hits a ghost. can anyone tell me how to make the screen follow pacman? I made the maze bigger than the white square... and how can i make the score stay in a fixed location after i make the screen stay centered around pacman? also, how do i make the ghosts move faster?