So, i have the enemy following the player using
on opencard
set movespeed to 10
move image "Skeleton gif" to the loc of image "Grado gif" in 1 second
move image "Skeleton gif 2" to the loc of image "Grado gif" in 1 second
end opencard
grado is the name of my player by the way anyways, once the 1 second passes, they follow but stop at the point where Grado started and stay there and stop following, how do i make it so they follow me constantly until i kill them
Ant
Moving an enemy image towards the player
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Moving an enemy image towards the player
I think you need to explain a bit more.
Could you upload your stack here, as a ZIP file ?
Could you upload your stack here, as a ZIP file ?
Re: Moving an enemy image towards the player
You're only requesting the move happens once.
Try this.
on opencard
moveGrado
end opencard
on moveGrado
put 10 into movespeed
move image "Skeleton gif" to the loc of image "Grado gif"
move image "Skeleton gif 2" to the loc of image "Grado gif"
send moveGrado to me in 1 second
end moveGrado
You may also want to put the movespeed value into a global so you can access and change it at any time from any card or script.
add this to your openStack script
global gmovespeed
put 10 into gmovespeed
https://livecode.com/resources/api/#liv ... cript/send
https://livecode.com/resources/api/#liv ... ipt/global
Try this.
on opencard
moveGrado
end opencard
on moveGrado
put 10 into movespeed
move image "Skeleton gif" to the loc of image "Grado gif"
move image "Skeleton gif 2" to the loc of image "Grado gif"
send moveGrado to me in 1 second
end moveGrado
You may also want to put the movespeed value into a global so you can access and change it at any time from any card or script.
add this to your openStack script
global gmovespeed
put 10 into gmovespeed
https://livecode.com/resources/api/#liv ... cript/send
https://livecode.com/resources/api/#liv ... ipt/global
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
Re: Moving an enemy image towards the player
i think you have misunderstood,
i want the enemy skeletons to continue to follow Grado throughout the level.
Ant
i want the enemy skeletons to continue to follow Grado throughout the level.
Ant
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Moving an enemy image towards the player
That's what the script does. Every time moveGrado executes, it sends a command to itself to do it again in one second.i want the enemy skeletons to continue to follow Grado throughout the level.
Technically, the command name should be in quotes though:
Code: Select all
send "moveGrado" to me in 1 second
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com