Topic was automatically imported from the old Question2Answer platform.
Asked By
cobracon
in a game I’m making, the player has a sword that points toward the mouse, and the enemies have weapons that point towards the player. But, i have no idea how to make it so that the player deals damage to the enemies and vice versa.
now you also can add an area to the sword of the player, and to the weapon of the enemy.
you can now test if the enemy/player is getting hit by the sword of the player/enemy.
If the players swords area hits the area of the enemy itself, the enemy should get damage.
if the enemys weapons area hits the players area, the player should get damage.
the code for the stuff i say here, you will probably find pretty easily on the web.
if not, feel free to ask me