Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP
- Alexcamostyle
- Scratcher
81 posts
Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP
I want the enemies in a game I am making to follow the player in live time. (As in, the player moves, so does the enemy.) I can't have the enemy
point towards the player, that would mess my game up. Is there a way to do this?
point towards the player, that would mess my game up. Is there a way to do this?
Some of my projects:
•(Almost) Infinite Score Engine
•Building Minecraft
•Into Space: An Airformer. (Was curated on the front page!)
•The “Circle” of Life
•Lots O Coins
•Simon (WIP)
- turkey3
- Scratcher
1000+ posts
Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP
- Alexcamostyle
- Scratcher
81 posts
Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP
when gf clicked //enemy script
set rotation style [left-right v]
forever
if <([x position v] of [player v]) < (x position)>
point in direction (-90 v)
change x by (-3)
else
point in direction (90 v)
change x by (3)
end
Thanks! Can I do the same with Y?
Some of my projects:
•(Almost) Infinite Score Engine
•Building Minecraft
•Into Space: An Airformer. (Was curated on the front page!)
•The “Circle” of Life
•Lots O Coins
•Simon (WIP)
- Theprodigy
- Scratcher
100+ posts
Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP
In the same way:
if <([y position v] of [player v]) < (y position)> thenJust add this to the script turkey3 posted (put it in the forever loop)
change y by (-3)
else
change y by (3)
end
- Alexcamostyle
- Scratcher
81 posts
Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP
Thank you both! These ideas worked. (I tweaked it a bit, to fit my game)
Some of my projects:
•(Almost) Infinite Score Engine
•Building Minecraft
•Into Space: An Airformer. (Was curated on the front page!)
•The “Circle” of Life
•Lots O Coins
•Simon (WIP)
- Discussion Forums
- » Help with Scripts
- » Enemies that follow you in live time. (NOT in a scrolling game) NEED HELP