Hi everyone!
This project lay on my drive unused lots of time, so i want to share it with you. Its works pretty good i think. Its basement for stealth game with curlently five kind of enemies: sniper, melee, range, pyro and demoman (yes, i'm TF2 player ). All enemies are "clones" of one object, class is defined by instance variables. Every single enemy (not class) can be customized with instance variables:
- class
- howManyPointsIGot
- weaponRange
- howCloseICanBe
- speed
- confusionTime
- shotingDelay
- myStyle
"myStyle" defines visual type of enemy. List of animations is defined by 3D string array.
Enemy AI is siple: enemy is patroling area using his own waypoints. Numbers of maximum waypoints (for all enemies) is preety smple and "cost" one event. Of course every enemy can use diffrent amount of waypoints, its defined by "howManyPointsIGot" variable. If enemy see Player object he run to him and start shoting if in "weaponRange". Enemy stops at "howCloseICanBe" distance. If enemy lost Line of Sight Run where he saw Player last time. If he reach this point and still didn't see player, he is "confused" and go back to his patrol. Exception is sniper, who run after you only if he lost LOS.
Idea of lvl creation is: use walls, and another objects in middle layer. In foreground and background textures, last layer is HUD. In my opinion its will recude collisions calculation.
LOS obstacle is Wall and LosingLOS. LosingLos helps debug map.
Download link from my google drive:<will be there when my rep allows me that :/ Is to download on the bottom of topic too> Unfortunetly I have problem with upload to Scirra Arcade expamples (zip include wrong files problem).
I do not predict i will continue this project, my art skills ends when circle/sqare is not enough (mabye little expand of code in free time, subevent in partoling), so if someone want use it, he got my blessing and i can describe some more