Definitely a lot going on in this lab. I think for the game I had in mind, I will probably rework some things, since the combat will mostly be ranged, but I was able to get everything working that was covered in the lab.
A weird blip was that after adding the stay_on_platform functionality, enemies without that check wouldn’t turning when hitting a wall. So I separated the wall collision part from the stay_on_platform argument:
Probably a prettier way to do it, but this ended up working.
After doing the obstacles lab, I think I understands signals a little bit more. I think I’m getting the hang of some of the code stuff now, so I didn’t have too many issues. Because I have my character’s arm as a separate sprite (to follow the mouse for aiming) I needed to do an extra step, to make sure it turned invisible when the character takes damage and dies. So I added that here:
Here’s it all together:
Five lives so I could do that last three-plant-hit combo…
I finished the player physics lab, and while it’s still rough around the edges, I think it’s a good place to stop for now. There are a lot of things to keep track of code-wise, but I think I was able to get a hold of it eventually.
I was able to add a double-jump (although there’s likely a better way) and here’s how I went about it:
I added two new variables: jump_max for the maximum number of jumps you can take (which I exported so you can edit it quickly) and jump_count for keeping track of how many jumps the character has left.Jump Max in the Player properties.I added “jump_count > 0” as a condition for can_jump. The jump_count resets every time you touch the ground. And 1 is subtracted from jump_count everytime you jump.
So, here is everything together. I also added the arm to the player (doesn’t follow the mouse yet) and changed how gravity and jump height is calculated so I could get more consistent jumps.
I swear there is sound; it just wasn’t recorded. I’ll fix that one of these days.
I didn’t add any additional items or graphics for this assignment, but plan to use this file as a template when doing the rewards art and might use that as an opportunity to add more stuff/things. I’d also like to go more in depth into how the metrics works, as I imagine they’ll be key if I want to integrate ammo/additional guns into the game in the future.