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

#76 2013-01-28 18:04:16

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: How to tell a variable to go to a certain location.

Ernie:

Thanks again.

Really? That's weird, I would think more people would at least say something pertaining to your birthday... Oh well, i guess they just missed it.  sad

sonicfan:

Oh, okay. Do you know when they're releasing the full 2.0?

Both of y'all  smile  :
Well, I might need help one another project that i haven't started yet; Do you know anything about 2.0?
I'm wanting to make a Pacman game that's a scroller (Pacman stays in the center of the view port and the bigger-than-the-screen maze moves to make it look like he's moving).

I need to know:

How to use the clone thing to make pellets.

How to make the stage move(I might know this one).

How to make the ghost's follow him.

How to make him stop at the walls.

If y'all can help that would be great.

Regards,

CAA14

Offline

 

#77 2013-01-28 18:25:39

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: How to tell a variable to go to a certain location.

CAA14 wrote:

Ernie:

Thanks again.

Really? That's weird, I would think more people would at least say something pertaining to your birthday... Oh well, i guess they just missed it.  sad

sonicfan:

Oh, okay. Do you know when they're releasing the full 2.0?

Both of y'all  smile  :
Well, I might need help one another project that i haven't started yet; Do you know anything about 2.0?
I'm wanting to make a Pacman game that's a scroller (Pacman stays in the center of the view port and the bigger-than-the-screen maze moves to make it look like he's moving).

I need to know:

How to use the clone thing to make pellets.

How to make the stage move(I might know this one).

How to make the ghost's follow him.

How to make him stop at the walls.

If y'all can help that would be great.

Regards,

CAA14

Well I had people sing Happy Birthday to me all day long, so it looks like people just didn't notice.

Anyway, about a moving background, what you're really looking for is something called "scrolling" I'll be back with a link to a wiki article about this...

Also, about the cloning, one thing that you could do is have two lists (XPos and YPos), then have the sprites clone and set their local variables (ScrollX* and ScrollY*) to it. From there, just have them clone a scrolling script and a script to make them hide/delete theirselves when needed.

Now, about the wall detection, this would take awhile to type, and there really isn't a nice wiki article on this, so you could look through my projects, or you could look at some platformer bases, like this one (link to be added). They can be easily adpated into a Pac-Man game because the only difference between the two is that one has gravity.

As for ghosts, there are several ways to attack this, but each good one is nasty. A simple one could be to have the ghosts check for similar coordinates with Pac-Man and then to move in that direction, another simple one is to compare positions with him and to mo e in that general direction, and the third would involve occasionally running a path finding AI (nasty to create) and just follow the results, though this could lead to all of the ghosts following behind Pac-Man in a line.

I hope that this helps!

Note: Seeing as I've ran out of time, I can't get you the links above.

Last edited by ErnieParke (2013-01-28 18:36:41)


http://i46.tinypic.com/35ismmc.png

Offline

 

#78 2013-01-28 18:43:03

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: How to tell a variable to go to a certain location.

Well, okay.

Could you please explain a "list"?
I know its like a variable, but i know I'm missing something...
I tried to start it online at 2.0, but they have several things to change before I'm using that...

I think I know how to do the wall thing... I will make the wall always check for pacman or Vic versa and then tell pac to stop of he's touching it.  smile

Thanks again!

CAA14

Offline

 

#79 2013-01-28 18:51:38

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: How to tell a variable to go to a certain location.

CAA14 wrote:

Well, okay.

Could you please explain a "list"?
I know its like a variable, but i know I'm missing something...
I tried to start it online at 2.0, but they have several things to change before I'm using that...

I think I know how to do the wall thing... I will make the wall always check for pacman or Vic versa and then tell pac to stop of he's touching it.  smile

Thanks again!

CAA14

Well a list is like multiple variables side by side. That's the only difference; the fact that it can store more than one item. So think of it as what it is in real-life: a list.

Your welcome!

Last edited by ErnieParke (2013-01-28 18:52:20)


http://i46.tinypic.com/35ismmc.png

Offline

 

#80 2013-01-30 12:00:21

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: How to tell a variable to go to a certain location.

Thanks again;

Regards,

CAA14

Offline

 

Board footer