Dev Log Ship Game - 2 NOV
2 NOV 2020
I’m putting a lot of time into the ship game because I’m VERY CLOSE to completing what I consider the third milestone. For this one I want there to be random generations of maps, spawning enemies, player, and powerups that all work properly. It won’t be a complete game yet, but it will have the entire gameplay loop. Or at least, it should.
As such, today I put a waypoint in each of the rooms that the AI detect on creation. I added a brief buffer from when the map is generated and when they start looking for waypoints/start patrolling. This helps just to make sure that load times don’t affect whether they work properly or not. Lo and behold, the patrolling enemies are able to navigate the whole map no problem!
3 NOV 2020
I was having a HECK of a time figuring out what was going wrong with my player spawning. At this point, the map spawns and the pawns are able to move about just fine, but spawning them into the map turned out to be tricky. This is just another example of load times being a pain in the neck, with On Awake or On Start being violently different. See, the map generator handles the .. generation of the map. The Game Manager handles the creation of all the pieces. I obviously want the pieces to spawn after the map is created, because the map also holds the spawn points. Trying to tell the game manager that the map has spawned and then to look through all spawn points and pick one at random gave me a longer headache than I care to admit. Coupling that with the fact that the player controller is looking for a player ship, and then they need to hook up in the proper order, and it took me a minute to get that all organized.
4 NOV 2020
With the problem solved of having the player spawn and connect its pieces to the player controller, doing that for AI was a breeze. I now have it that the player and AI all spawn on the game beginning, with each of them being hooked up properly, knowing who their targets are, and patrolling properly. This has essentially just given me the same functionality as before the map generation, only now things are random and flow properly. Likewise, on player death or all AI deaths, respawning is possible.
6 NOV 2020
AAAAAAAAAND Milestone 3 is done! With the work I put into powerups before, attaching functions to them was easy. I probably spent the most amount of time on the chainshot because I thought the idea was really cool but a little tricky to implement. My solution was that the projectile is also a powerup, but one that “adds” a new speed of 0 to the player who “picks it up.” This means I can use the same parameters like lifespan, amount, and pickup to it. The rest, such as speed and health, were all the fun of that without having to figure out how to treat something like a projectile and a powerup, and how to swap between models.
![](https://static.wixstatic.com/media/c9293c_614326b972ef49d5859979df9fc973c1~mv2.gif/v1/fill/w_507,h_338,al_c,pstr/c9293c_614326b972ef49d5859979df9fc973c1~mv2.gif)
Kommentare