Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Shooting problems


Recommended Posts

Im not too good at explaining stuff, but...

this is for him shooting at you when your on the left.

---X Position of player < X position of Enemy --->

---Direction Of Enemy is facing (<-- *this way)

-*enemy shoots at player*

Do the same for the right.

---X Position of player > X position of Enemy --->

---Direction Of Enemy is facing (--> *this way)

-*enemy shoots at player*

To make it more realistic, you need to set a distance that he starts shooting at you.

For instance, if you want them to see you almost instantly (player on the left), Do this:

---X Position of player < X position of Enemy - 500 --->

---Direction Of Enemy is facing (<-- *this way)

-*enemy shoots at player*

This makes it so he only shoots at you when hes facing you, and your player is within 500 pixels to the left of the enemy. Lower it to make his vision worse, highten it to make his vision better.

But make sure you put a restriction on there, otherwise hes going to shoot at you whenever hes turned to you, even if your nowhere near him.

You also need to make an event that sets you in a certian Y range, otherwise you can be under him and he will still "see" you.

So alter the above events like this (when your on the left):

---X Position of player < X position of Enemy - 500 --->

---Y position of Player > Y position of Enemy +50

---Y position of player < Y position of Enemy -50

---Direction Of Enemy is facing (<-- *this way)

-*enemy shoots at player*

And when your on the Right :

---X Position of player > X position of Enemy +500 --->

---Y position of Player > Y position of Enemy +50

---Y position of player < Y position of Enemy -50

---Direction Of Enemy is facing (<-- *this way)

-*enemy shoots at player*

Now, he can only see you if your pretty much on the same plane as him. You may want to highten it a bit for when you jump. (+50 pixels isnt very much.)

That gives him a full range of view. This method can allow the enemy to detect you without having to give them all Active Objects for their view field.

Just do the same thing for when your on the right.

Alter the pixel range to fit your needs.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...