dark        
Osc blog header photo
Osc's c-blog
Posts 1495Blogs 38Following 0Followers 13


 
 

LONG BLOG

Game Start 11

   0

intro 11

11 months - is that how many months I've been doing this? Geez, I was just a youngin' back then. I've actually been playing a lot lately to keep myself from going crazy - Horizon: Zero Dawn is a great game by the way!

Last time we had done a lot of work with back-end and UI stuff. Most of the work was completed last month. This time it was a few touch ups here and there. There wasn't that much to do this month, as these were the last few videos. Basically, I finished it this past month!

This one is short and sweet. So let's see what was left.

Bad code

What you see above is a logic problem that I ran into. The basic gist of this is that this method will reset my game once the last level is complete. Here, currentSceneIndex represents the active level we are currently playing. The nextSceneIndex variable is the next level (currentSceneIndex + 1). Then in the if statement, I basically say if the current scene is equal to the last level of my game, reset the next scene to 0. The following statement will then load whatever level nextSceneIndex represents.

This is wrong. This is because I ask if the current scene is equal to the last level. Because currentSceneIndex never changes this statement will not reset my game. Sure, nextSceneIndex will be technically right and my game will load the levels. But if I have 4 scenes, and nextSceneIndex holds 4 but adds 1 to make it hold a value of 5, then the game crashes. LoadScene method will not find those extra levels.

Here is what it should look like:

Working code

Now the nextSceneIndex variable is what is being checked. Because that variable is changing, it can enter the next statment inside, which resets itself to zero and thus looping the game back to level 1.

A simple mistake like that can really suck. And when I first started programming, I would spend HOURS, on the tiniest stupidest mistakes. Typos, misplaced brackets, logic issues and such would make life miserable. But you learn. And luckily I caught this pretty fast.

But that was pretty much it. After testing if I had broken anything else, the game seemed to run pretty well. Then it was just simply polishing anything that felt off or maybe improve. I was done!

Here a short demo of my game. The creators of the project say you should show off a short moment to entice players into playing the full game. I thought this was a very good point. How many times have we seen someone link something and say, "Hey I made this thing - click the link to try it out". I can say almost every time, I never follow through - even though it literally takes seconds. So to make people follow through on the link - show them a very short video/gif of the game. At least this way, they can instantly decide if it's something to see.

 

Here's the link to my game:

http://www.sharemygame.com/share/105b2dd2-dddd-4d05-8668-d10745154ef7

A and D keys rotate the ship. Space key makes the ship go forward. (Definitely should've said that in the game - oops)

That link is good for 30 days, so depending on when you're reading this, it may be gone.

I'm not really looking for constructive criticism because I know already there's so many things I can do to make this game better. The whole point of this project was to get used the Unity Editor, the tools, and basic architecture of building a game. I didn't spend too much on the design aspect. I just wanted to get my feet wet, so to speak. Although it took a while, I feel much more comfortable than when I started. I think I will do another simple game, but make more choices based on design - you know, make it fun!

But that doesn't mean don't play the game. Please do! I still want to hear your thoughts. What would you add? Are the controls weird (I think they are)? Did I actually fuck up and upload a buggy game? Let me know.

Welp, that's it for now. I gotta start making my game.

Login to vote this up!

LOOK WHO CAME:


Osc   


 
 

  0 COMMENTS

Please login (or) make a quick account (free)
to view and post comments.



 Login with Twitter

 Login with Dtoid

Three day old threads are only visible to verified humans - this helps our small community management team stay on top of spam

Sorry for the extra step!

 

About Oscone of us since 9:37 AM on 11.12.2011

Talk, play games and make the funnies.

Twitter: https://twitter.com/oscmolo