AI & structure
|
Hello! So this week I have been working on the following AI and a better way to draw the rooms that the map are currently creating. The first I did this week was start with a AI for our enemy number 2. But the as I have progressed slowly in the work and we are going to show an alpha this Friday (tomorrow). I decided to change my priority work this Wednesday. As of now that might have been to late and I shall now proceed to tell you about the two. AI How will our AI work for enemy 2?
It will then detect if a player is inside its radar like the circle above. To make it more life like it will then move a half of a half circle around the player and shoot again. So this should be simple in SFML right? Just create a circle using sf::CircleShape; for detection and then create the sprites and use them This is however were the code went tricky. When searching for a ”simple” detection algorithm it suggested that I use the circles radian and Pythagoras calculation in order to calculate if something was inside the circle. Upon doing that several setbacks happened. Well after that I did more research and ended up with a lot of things that needed to be tested. Not something I would manage to create before the show of our Alpha. So I decided to change my work to something more productive. Creating a map So I decided to create the level and make doors that go *swoosh* when you go through them. BUT! I ended up with a snag. Yesterday I took a look at our so called code and saw a giant flaw in it. It’s messed up. after sleep I could not see how the rooms are positioned in my mind and that’s a problem. 0 being outer space and 1 being the rooms.
This would read the file and then decide upon that how the tiles were set. Then after starting to do this realization came, how are we currently handling so that the character can’t walk out of a room. A Room class had been created that handled this perfectly, however to be able to walk between rooms they have to be active. As far as I can tell right now. The rooms them self have a set length and use a setTextureRect(sf::IntRect()); They also need something ”like a door” between them in order to walk between them. And I went to a standstill again. I am currently writing this blog because I think I will have to work a lot this evening and won’t have time to write it then, so I can’t come with a real answer to how or when this problem will be solved but I can tell you one thing: Our code needs better structure and we programmers need to communicate better in our group. |

