Discuss Scratch

jackycarson
New Scratcher
11 posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

In Pacman when the ghosts go blue how could you make a script that lets pacman eat them. Help me.
jackycarson
New Scratcher
11 posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

I would prefer a video walkthrough or a picture if you guys don't mind to.

jamiewinter
Scratcher
100+ posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

Sorry i cant make a video or picture but if you have the death script, put it in an if else block (put it in else) Have in the if: <if touching colour blue> broadcast Ghost () eaten (dependant on which ghost) and have the ghost (when he recieves it) hide and go to centre wait () sencoonds and show (if you have points just add whatever to them after he is eaten)
turkey3
Scratcher
1000+ posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

Try this
-when pacman collects a dot, set a variable called “edible” to yes
-broadcast “run ghosts”
-have the ghosts switch to their blue costumes when they receive “run ghosts”
-when the ghosts are blue and then change back turn the variable “edible” back to no

-if pacman ever touches a ghost
-if edible = yes
-eat the ghost
-else
-pacman is eaten
jakegame123
Scratcher
5 posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

MUHFMUHFMUHF
wkelly42
Teacher
100+ posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

When Pacman eats the pellet, the ghosts change costumes to the blue one. When Pacman hits a ghost, check to see which costume is active on the ghost. If it's the blue one, pacman gets a snack. If it's the regular one, the ghost gets a snack
Rynzlonium
Scratcher
1 post

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

Guys I need help on this too. Please include a video or picture ASAP.
gtoal
Scratcher
1000+ posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

Rynzlonium wrote:

Guys I need help on this too. Please include a video or picture ASAP.
Videos or pictures won't help. You need code.

There are many pacman-like games on Scratch. “look inside” some of them.

Do you just want to know how the actual eating works (how to detect that a ghost caught pacman, or pacman caught a blue ghost and changes color) or do you need to know how to make the ghosts chase after pacman? (which is a bit more complex)

Last edited by gtoal (Sept. 10, 2016 22:47:03)

mineandcraft767
Scratcher
6 posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.


make a varible named edible or power pellet

go to opearators find this block {blank = blank}

now put edible into {blank = blank} it will be like this {edible = blank}

now in the last blank part you need to copy this for an another one now

in that two blocks type this {edible = yes} {edible = no}

you need {edible = no} for dieing you need {edible = yes} for eating ghosts

bring two of this blocks if then

put {edible = yes} in the first if then block and then put the another in the second one

if then (1) if then (2)
{edible = yes} {edible =yes}

now how do you die?


download game over sound

download some pictures pacman is dieing

do this
-forever
-if then
-play sound game over
-switch costume to game over 1
-wait 0.1 seconds
-switch to costume game over 2
-wait 0.1 seconds
-switch costume to game over 3
-stop all

now how do you eat ghosts?
do this
download power pellet sound

-forever
-if then
oh i forgot to tell you something you need an another if block
- if then
-hide
if that does not work go to this project https://scratch.mit.edu/projects/512047386/
scratchcode1_2_3
Scratcher
1000+ posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

Why is no one using scratchblocks? anyways, it should look like this:
when green flag clicked
forever
if <(scared) = [false]> then

chase pacman
switch costume to [normal v]
else
if <(scared) = [true]> then
switch costume to [scared v]
go away from pacman
end
end
legendary34678
Scratcher
1000+ posts

Pacman - When the ghosts go blue how to mkae a script that lets pacman eat them.

Hello there!

scratchcode1_2_3, you might not have realized that this topic is from 2013! Please check the original post's date before answering other peoples' questions.

mineandcraft767, please don't necropost on old topics. It brings old topics to the front of the forum and prevents people from getting the help they need.

Thanks!

Powered by DjangoBB