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

#1 2013-04-02 14:50:11

arttstone
New Scratcher
Registered: 2011-08-14
Posts: 4

PacMan Scripts help

I worked with my class and we created a Pac Man Game and I stepped the class through with the scripting and one student when they play their game the ghost move then line up in a row and don't move any more. I have looked through and as far as i can see everything seems to match up but I am not sure.  Here is the link to the project: 

http://scratch.mit.edu/projects/arttstone/3229157

Can anyone help?

Offline

 

#2 2013-04-03 14:02:07

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

I've found a glitch that will take some time to finish: when you get a 'pellet' instead of having a:

change [score v] by (1)
it has a:
set [score v] to [1]
but I've tried looking for the cause of the glitch stated above and I can't find it either. Good-luck trying to find/fix it.

Sincerely,
topazdragonlord


http://i45.tinypic.com/idumbk.png

Offline

 

#3 2013-04-03 18:21:07

arttstone
New Scratcher
Registered: 2011-08-14
Posts: 4

Re: PacMan Scripts help

Thank you I missed that one. I keep trying but still not sure where it is coming from.

Offline

 

#4 2013-04-04 05:53:57

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

don't worry I'm sure you'll find it eventually and your welcome btw  smile


http://i45.tinypic.com/idumbk.png

Offline

 

#5 2013-04-04 08:41:44

liam48D
Scratcher
Registered: 2013-02-18
Posts: 33

Re: PacMan Scripts help

You will find it in your pellet section sprite.

when gf clicked
show
forever
  if <touching [PacMan]
    play drum [48] for [0.2] beats
    set [score] to 1 --- change [score] by 1
    hide
    stop script
  end
end

Offline

 

#6 2013-04-04 09:37:08

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

liam48D wrote:

You will find it in your pellet section sprite.

when gf clicked
show
forever
  if <touching [PacMan]
    play drum [48] for [0.2] beats
    set [score] to 1 --- change [score] by 1
    hide
    stop script
  end
end

when gf clicked
show
forever
  if <touching [PacMan v]?>
    play drum [48 v] for [0.2] beats
    set [score v] to [1]//should be change score by 1
    hide
    stop script
  end
end
Fixed  smile

Last edited by topazdragonlord (2013-04-04 09:38:40)


http://i45.tinypic.com/idumbk.png

Offline

 

#7 2013-04-04 12:30:41

arttstone
New Scratcher
Registered: 2011-08-14
Posts: 4

Re: PacMan Scripts help

Thank you that helps the score. Any idea why the ghosts are freezing?

Offline

 

#8 2013-04-04 12:58:34

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

arttstone wrote:

Thank you that helps the score. Any idea why the ghosts are freezing?

Unfortunately None. - But I'll try again to see if I can find out

Last edited by topazdragonlord (2013-04-04 12:59:00)


http://i45.tinypic.com/idumbk.png

Offline

 

#9 2013-04-04 13:15:44

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

I've just spent like 30 minutes and I can't seem to find anything, but I think it has something to do with the movement scripts in the ghosts because there warping around and disappearing. Good-Luck  smile


http://i45.tinypic.com/idumbk.png

Offline

 

#10 2013-04-05 12:00:13

arttstone
New Scratcher
Registered: 2011-08-14
Posts: 4

Re: PacMan Scripts help

I appreciate the help!!

Offline

 

#11 2013-04-05 12:27:33

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

Your welcome  smile


http://i45.tinypic.com/idumbk.png

Offline

 

#12 2013-04-05 21:28:47

PaulBrownMagic
New Scratcher
Registered: 2013-04-05
Posts: 15

Re: PacMan Scripts help

Found it! I hope this is it. In the ghost's forever loop there's a bit:

if (direction)=[2]
  point in direction [90]
  set x to [-1] * (Ghostspeed)
Where it should be

if (direction)=[2]
  point in direction [90]
  change x by (Ghostspeed)
I hope that fixes it!

Offline

 

#13 2013-04-05 21:34:53

PaulBrownMagic
New Scratcher
Registered: 2013-04-05
Posts: 15

Re: PacMan Scripts help

Didn't quite get the if statements right with the scratch blocks, but I hope you can still read it!

Attempt 2:

if <(direction)=[2]>
  point in direction [90]
  set x to [-1] * (Ghostspeed)
end
Should read:

if <(direction)=[2]>
  point in direction [90]
  change x by (Ghostspeed)
end

Offline

 

#14 2013-04-07 07:40:59

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: PacMan Scripts help

awesome congrats  big_smile
I checked that bit but didn't really get anywhere  smile  - well done!


http://i45.tinypic.com/idumbk.png

Offline

 

Board footer