Put all the sprites in a family called canBeClose and test all members of the family for nearest member of the family canBeClose (excluding the family member of canBeClose doing the testing of course). If distance is < how_close_is_near then set the boolean to true in the canBeClose member doing the testing.
do this every tic or every .03 seconds.
yours
winkr7
You could create a shadow (invisible sprite) that follows the player about a half second later. Then have the AI look for the shadow rather than the player so it is always looking at where the player was a half second ago.
You could create several of these with delays etc and have the AI pick the one it goes after at random.
just some thoughts.
You were around for rex rainbow and how that didn't end well. I am not a good enough programmer to know how to build an inheritance type API you could expand but that seems to work in other development environments (I am looking at Fortnite's ecosystem atm).
Good luck with your expansions.
Look at the persistent inventory example. That is a place to start.
Do you mean you are using the canvas object while in run time, or is this pasting to the layout? If it is the layout at design time you probably have snap to grid turned on.
You can find closest and farthest sprites--this makes the code simpler if that is what you are after. If you want all the sprites in a certain range you can check which overlap a round fake-sprite centered on the player. Why are you doing the comparison?
You do not have permission to view this post
It is coming along well. Looking forward to an alpha.
If you have two surfaces that exactly overlap (say a water lilly floating on a surface or something hanging from a wall) you get lots of flicker when you move the camera but when you stop it settles down.
Just an observation.
Develop games in your browser. Powerful, performant & highly capable.
I like bringing a project back from years ago and being able to get it working in the most recent version. I also like being able to run off of browsers.
This is great.
My mistake, I thought your function had three parameters (I saw the variables).
in a new block declare a variable, lrValue as a string variable.
set lrValue=function.blockLeftright
lrValue will now contain the string "left" or "right".
Member since 23 Oct, 2014 Last online 22 Nov, 2024