This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-01 05:36:27

macross15
New Scratcher
Registered: 2012-06-01
Posts: 1

Help needed in Creating Ghost Random Movement pattern

Hi fellow Scratchers,

I am attempting to make my own Pacman game. I am relatively new to Scratch but so far i have been doing well. But now I am trying to program a Ghost sprite to track down the pacman.

I started by plotting a course for Ghost to follow, encountered issues with paths crossing and where to start and loop the Ghost....also the path is not random either so its not really the idea.

Then I tried making a follow command for the ghost. The trouble I encountered here was the turning of the ghost...so i altered and fandangled costumes and used operator controls plotting turn points but....still the ghost would turn at funny angles and get stuck on walls because it was programmed to point towards Pacman.

so what should i do now?

Offline

 

#2 2012-06-01 06:28:10

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: Help needed in Creating Ghost Random Movement pattern

This is a very complex project... probably beyond my knowledge...

All I can say is check out other already-made pacman projects. This is a well made project that you might want to download and see how it's done.


http://i46.tinypic.com/ao03lk.png

Offline

 

#3 2012-06-01 10:15:16

shpeters
Scratcher
Registered: 2011-12-11
Posts: 100+

Re: Help needed in Creating Ghost Random Movement pattern

It would be easiest to make it either two player or make it not need to follow the pac-man.

If it is two-player just copy the pac-man's moving scripts.

I recommend making the ghost not follow the pac-man.

This would be better with multiple ghosts so just copy the scripts to them.

First put almost invisible dots at all the turning points.

Then

when gf clicked
forever
if <not <touching color [#00FF00]?>>
move (2) steps
else
set (var) to (pick random (1) to (4))
if <(var) = (1)>
turn cw (90) degrees
end
if <(var) = (2)>
turn cw (180) degrees
end
if <(var) = (3)>
turn cw (-90) degrees
end
if <(var) = (4)>
turn cw (0) degrees
wait (0.1) secs
end
Tell me if there are any problems.


http://i.imgur.com/bboYO.pnghttp://i.imgur.com/66Yki.gifhttp://i.imgur.com/uLUsl.jpg

Offline

 

Board footer