Discuss Scratch

_Euphoric_
Scratcher
10 posts

Player Vision Formula Not Working Correctly

The Project
SO basically I made this infinite fighting game, with randomly spawning enemies. But the problem is that the enemies are supposed to stay on the ground (I used a basic scrolling mechanism) and not with the player while the player is in the air (jumping). And also, when the player moves, the enemy is supposed to appear moving in the other direction. This also does not work. And finally, I added a formula that, if the enemy is in the player's FoV (240 pixels of x) the enemy appears (ghost set to 0), otherwise it hides (ghost set to 100). The formula is something like this:
if <<((player x) - [240]) > (myXpos)> or <((player x) + [240]) > (myXpos)>> then
set enemy to cannot see me :: custom
else
set enemy to can see me :: custom
end

*serious suggestions and comments only, please do not advertise your problem or say “maybe this…” *

Last edited by _Euphoric_ (March 9, 2022 22:54:05)


I have moved from @ImAnPopularYoutuber1 to here, so I have like 5 posts instead of 100+.
when green flag clicked
cringe :: custom
ImAnPopularYoutuber1
Scratcher
100+ posts

Player Vision Formula Not Working Correctly

*above is my new account, so 1 post instead of 100+*




PS: would you like to give me an Internet? Then click on the blue text! also please click this: CLICK ME

Powered by DjangoBB