Getting more organized

This week we’ve restructured almost the entirety of our project, and cleaned up a lot of code and assets that were not needed/badly organized.

After a while, assets start piling up, creating redundancy. This can lead to wasted time (while searching for the right assets from perhaps five similarly named yet different assets) and space (obviously). While it takes time to do the cleanup, it eventually gets to the point where it is more efficient to do the cleanup than to leave them be.

How to do the cleanup? It’s simple. Find and delete all un-used assets! Since I’m the programmer, I focused on code cleanup. Any code that wouldn’t be used at all was deleted. Anything with inefficient code was re-coded, keeping the useful parts, deleting the parts that weren’t used, and changing the parts that can be better coded.

To do most of the cleanup, we decided to create a new unity project and move everything over bit by bit, making sure that everything works properly at every step, and then cleaning it up afterwards.

While doing this, we noticed a number of small inconsistencies that were fixed, and we got a good overview of our game design as well. This made us realize that we needed to change some things around to make sure that the game was actually engaging, which was great.

Something we noticed while reimplementing the movement and shooting mechanics of the moth, is that we really needed to redesign it. We started with thinking about what we really wanted out of the mechanic of shooting. We realized that we probably needed mouse aiming for the shooting.

I implemented the mouse aiming by first getting a direction vector by using vector subtraction of the mouse-position with the players position:

jl8vh
Vector Subtraction (for real this time, thank you, Sill)

You get the direction and distance between two points (defined as vectors) by subtracting one from the other.

 

I then normalize that vector, which sets it’s length to 1. I do this so that when I multiply it with the bullets speed later, it will have a consistent speed.

I then spawn an instance of the projectile object with that direction vector as the velocity for it.

Advertisements

Author: weakman54

I make games.

3 thoughts on “Getting more organized”

  1. Wow I feel retarded… I always use atan2 for directions but this is way easier and better… need to reconsider lyf. But pls check your text for errors; the text talks about subtraction but the image shows addition. welin pls

    Clean up is always nice – I dream about doing it for our project still. It’s good that you explain why cleanup ever would be nice to those who would rather implement new things… Transferring everything bit by bit to a new project is something I haven’t thought of, very cool. I assume this went smoothly since you don’t talk about any hiccups or anything. Would you recommend doing this as a standard?

    The text is well structured and ez to read. But I like pictures. pls add more pictures, even if they aren’t necessary for understanding (it’s nice, do it for the people).

    what/how/why all checked 5/7 blogpost I pray for you success glhf

    Like

    1. Oh, wow, must’ve been very tired when I added that picture, could’ve sworn it was of subtraction. As for the “Move everything over to a new project” refactor model: It’s more of an extreme measure for really messy projects, 3/10, would not recommend. Instead use the tried and tested “code a feature, refactor a feature, rinse, repeat” method, 10/10 gr8 tym. And Sill, pls, don’t talk to me about errors with that last sentence (and text structure in general).

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s