im making a game call zombie surivival im using x and y velocity but i need to know how to get the zombies to move randomly using x and y velocity
Offline
Firedrake969 wrote:
Try the wiki.
i cant find anything about this
Offline
You could use a variable set to between 1 and 4, and from there, use that to tell if the zombie goes up, down, left, or right, and add in another random variable to set the amout of strides he takes in the random direction. To make it more realistic, add in random pauses of random lengths. If you want an example of a script that is close to this, then you can look at my Chalkboard Pac-Man project. Remember that the script I'm talking about is the ghost's script. If you like it, then just chop of the top part of the script in the repeat loop, edit it a bit for use in open spaces, and you should be fine!
Offline
ErnieParke wrote:
You could use a variable set to between 1 and 4, and from there, use that to tell if the zombie goes up, down, left, or right, and add in another random variable to set the amout of strides he takes in the random direction. To make it more realistic, add in random pauses of random lengths. If you want an example of a script that is close to this, then you can look at my Chalkboard Pac-Man project. Remember that the script I'm talking about is the ghost's script. If you like it, then just chop of the top part of the script in the repeat loop, edit it a bit for use in open spaces, and you should be fine!
your scripts confuse me im not that good at scripting yet maybe you can look at my preview of my game and try to make a script for me http://scratch.mit.edu/projects/ZombieHappines/2652393
Offline
ZombieHappines wrote:
ErnieParke wrote:
You could use a variable set to between 1 and 4, and from there, use that to tell if the zombie goes up, down, left, or right, and add in another random variable to set the amout of strides he takes in the random direction. To make it more realistic, add in random pauses of random lengths. If you want an example of a script that is close to this, then you can look at my Chalkboard Pac-Man project. Remember that the script I'm talking about is the ghost's script. If you like it, then just chop of the top part of the script in the repeat loop, edit it a bit for use in open spaces, and you should be fine!
your scripts confuse me im not that good at scripting yet maybe you can look at my preview of my game and try to make a script for me http://scratch.mit.edu/projects/ZombieHappines/2652393
Sorry that they confuse you. I will look at your project and try adding some scripts to it. Then, I will post the project on Scratch for two days and I will let you know when I do, but it won't be today.
Offline
Download my project 'HumHum Round-Up'. I used a random moving script (for the humhum sprites) on hard mode.
Offline
ErnieParke wrote:
ZombieHappines wrote:
ErnieParke wrote:
You could use a variable set to between 1 and 4, and from there, use that to tell if the zombie goes up, down, left, or right, and add in another random variable to set the amout of strides he takes in the random direction. To make it more realistic, add in random pauses of random lengths. If you want an example of a script that is close to this, then you can look at my Chalkboard Pac-Man project. Remember that the script I'm talking about is the ghost's script. If you like it, then just chop of the top part of the script in the repeat loop, edit it a bit for use in open spaces, and you should be fine!
your scripts confuse me im not that good at scripting yet maybe you can look at my preview of my game and try to make a script for me http://scratch.mit.edu/projects/ZombieHappines/2652393
Sorry that they confuse you. I will look at your project and try adding some scripts to it. Then, I will post the project on Scratch for two days and I will let you know when I do, but it won't be today.
oh no its not your fault they confuse me im just not that good yet and thanks for helping
Last edited by ZombieHappines (2012-07-23 22:43:39)
Offline
ZombieHappines wrote:
im making a game call zombie surivival im using x and y velocity but i need to know how to get the zombies to move randomly using x and y velocity
The Script Is...
when gf clicked forever move [(pick random [1] to [10])] steps wait [1] secs point in direction [(pick random [-90] to [90]Also add another point in direction pickrandom [0] to [180]
Last edited by hunter6690 (2012-07-24 02:36:13)
Offline
hunter6690 wrote:
ZombieHappines wrote:
im making a game call zombie surivival im using x and y velocity but i need to know how to get the zombies to move randomly using x and y velocity
The Script Is...
when gf clicked forever move [(pick random [1] to [10])] steps wait [1] secs point in direction [(pick random [-90] to [90]Also add another point in direction pickrandom [0] to [180]
I think that he wants a script that has two variables describing the sprites motion; x velocity and y velocity. I don't see that in your script. Also, when turning, you should pick between -90 and 180, not 0 and 180. This will then give it a fuller range of motion.
Last edited by ErnieParke (2012-07-24 09:56:02)
Offline
ZombieHappines, I have a question that I would like answered before I start working on the AI.
1). Do you want the zombies to move:
a). Only left, right, up, down, and diagonally.
b). Any Direction.
I will still work on the AI, but this info will be greatly appreciated.
Offline
Try this:
when gf clicked forever glide <pick random (1) to (5)> secs to x: <pick random (-240) to (240)> y: <pick random (-180) to (180)> end
Offline
JH1010 wrote:
Try this:
when gf clicked forever glide <pick random (1) to (5)> secs to x: <pick random (-240) to (240)> y: <pick random (-180) to (180)> end
He needs to be able to have the variables x velocity and y velocity describing the zombie's motion. Also, in his project notes, he said that the zombies will slowly move towards the charcter, and I don't see that in your script.
Offline
ErnieParke wrote:
ZombieHappines, I have a question that I would like answered before I start working on the AI.
1). Do you want the zombies to move:
a). Only left, right, up, down, and diagonally.
b). Any Direction.
I will still work on the AI, but this info will be greatly appreciated.
b any direction and thanks for helping its really appreciated
Offline
I'm am done!
Here's a link to the project:
http://scratch.mit.edu/projects/ErnieParke/2693911
About b, well the zombies will move left/right/up/down when they aren't chasing you, but they will move towards you when they are. It's extremely difficult to make a script with x and y velocities and have the zombie move in any random direction (ex. 57 degrrees, -13 degrees, ect..) because then you have to go into trigonometry, and I don't want to do that. The zombies still move around randomly, but only at 90 degree intervals. Right now, there are 3 zombies.
Here is what I've changed:
1). 3 zombies to chase/kill you.
2). New hamburger image.
3). Hamburgers give 2 hearts now.
4). Better movement.
5). Sword added to kill zombies with.
6). Various bug fixes.
7). Move with the arrow keys or WASD.
Last edited by ErnieParke (2012-07-24 13:58:15)
Offline
I just added the ability to lose/win.
To win, kill all of the zombies. You'll find the script for this in Sprite3.
To lose, die. You'll also find the script for this in Sprite 3.
Offline
I don't know if you've seen my posts, so please say if you have/haven't. Thanks!
Offline
ErnieParke wrote:
Just updated it with some bug fixes.
i really appreciate the help youve done for me thanks
Offline
ZombieHappines wrote:
ErnieParke wrote:
Just updated it with some bug fixes.
i really appreciate the help youve done for me thanks
No, thank you. I really like to help people when I don't have my hands tied up.
Offline
ErnieParke wrote:
ZombieHappines wrote:
ErnieParke wrote:
Just updated it with some bug fixes.
i really appreciate the help youve done for me thanks
No, thank you. I really like to help people when I don't have my hands tied up.
hey Ernie i moved some stuff around changed zombies health a little and i made a new lose broadcast thing because the one you made only made sprite three disappear and not the lose sign pop up and it doesnt work and the health glitches out every once in a while can you help me again
Offline
I'll look into it and help. So, let me guess, you've updated your online version and that is what is having the problems. Okay. It's late right now (9:30 pm), so I won't update the project today.
Last edited by ErnieParke (2012-07-24 21:36:25)
Offline
ErnieParke wrote:
I'll look into it and help. So, let me guess, you've updated your online version and that is what is having the problems. Okay. It's late right now (9:30 pm), so I won't update the project today.
Hey Ernie I Have a proposition for you would you like to join Destructive Pixels Inc As Head Programmer
Offline
I'll think about it. Anyway, I've updated the project to version 0.1.4.
Here's a link:
http://scratch.mit.edu/projects/ErnieParke/2695575
Here is what I've added so far:
1). 1 more zombie added.
2). Half hearts added.
3). Cheeseburgers now give 1.5 hearts.
4). Zombies/weapons/food now don't spawn on top of you.
5). A new zombie appears after two seconds of a zombie's death.
6). Performance optimization.
7). Numerous bug fixes.
Offline