Sunday, December 29, 2013

Space Shooter Day 7

Today I work on the script for the asteroid I was able to make it moving downward or falling like an asteroid should however at first I discover that the asteroid continue to move downward forever therefore I have to write a conditional statement to make the asteroid re appear at the top of the screen.

then I start to think about to to make all the object actually interact with each other. In this case we will need a collision. In Unity you can add rigid body to a game object to give that put object under control of physic to give an object a more realistic movement.

Rigid body option

Here we have Gravity unchecked because we don't want our object to be affected by gravity, but instead use the transform or movement information we input in the code. so we switch it to kinematic instead. 

so I have that set up for all the game object so that so they will be able to interact later. 

Problem encounter: Forgetting to apply new changes 

So because I  make all object into prefab before making adjustment so I didn't know that when you make changes to it it doesn't change the original prefab sooooo when I close my work and come back to it the changes was never made... so I have to go back and re adjust everything. Luckily it wasn't much but now I learn 

see the apply button 
 Now I'm hitting apply like every 5 minute even if I didn't change anything >. > just to be save. 




Saturday, December 28, 2013

Space Shooter Day 6

  Today work main on the scripting for bullet. First I create new game object (aka the socket) and attach it to the current player to create area where bullet will be shot from. At first the bullet stood in place and did not move forward, but then when an additional translate code was added. Later the bullet was able to accelerated.

bullet in motion

I was unable to show on this blog a moving bullet but here is kind of what it look like.

However the mistake in this script is that bullet is not destroyed upon shooting, it instead continue to move upward into space forever. Which is not what I wanted to do. In the end I will need to figure out how to make the bullet disappear when it came into contact with the "enemy" game object.

[Update]
By Using destroyed I was able to make bullet disappear when it hit the height limit.

code for destroy 


Friday, December 27, 2013

Space shooter Day 5

Christmas is over! yay (?) which mean more time for work so that a good thing I suppose. 
Today I finish my final set up for my player script. I also organize and add comment to all the line so that when I look back at the code I would know what each line does. Variable may need to be adjust after other component is done but that can be easily change with the current set up Next thing to work on is script for bullet. 
Final setup for player script

Wednesday, December 25, 2013

Space Shooter Day 4

First Merry Christmas Eve and since it Christmas eve my cousins came over so I didn't get to work as much as I wanted to but anyway I continue with the player script today and all I accomplished today was adding to the player script a code that will limit the range of where the object can move giving your game a boundary.

and that pretty much it today...

My current work space 

Monday, December 23, 2013

Space Shooter Day 3

After spending majority of yesterday re learning basic of Java scripting today I was able to do able script for my player object which is a simple command allow movement base on input. Meaning I can now write a script ordering an object to move to corresponded to the set key, which in this case the object is able to move according to the directional keys.

First player script 

Lesson Learn:

Coding or computer languages is VERY specific. everything must be written in a certain way and even if you miss one thing the whole thing won't work. the mistakes I make often is forgetting to put ; at the end of each line. In scripting each line must end in ; ( I have no idea why, my upperclassmen just told me that, that just the way it is. Maybe I should look it up) and another mistake I make often is spelling error. you must spelling each words correctly! otherwise the computer will fail to recognize the code. Luckily Unity have console check that kind of give you an idea of where the error might be.


Comments:

Now I get the ideas of how work must be put into those games I see. Like MMO, and all the console games. If a simple shooter take this much time no wonder many games take years to be made. Now every time I play games I will appreciated all the work they put into it.


Sunday, December 22, 2013

Space shooter Day 2

Problem #1

So today I was starting to try out different pre made script that can be found on Unity website. Although I can get the game object to move by inputting a pre made script I don't really understand the basic too well so it make it impossible to make an adjustments on my own so I decide to take a step back and take a look at "The Fundamentals of Scripting" this will really set me behind the scheduled but I don't think it a good idea to proceed with out the understanding of the scripting (which is like doing advance math without the basic...It doesn't work well...or at all ...I should know) which is properly the most important part of this whole thing. I figure I could caught up if I put in more hours into the project per day.

Self Reflection:

this problem really show my lack of research and preparation which I admitted I didn't do so much research on the technical part. I thought that I could get by with just understanding the program interface and functions, but as you can see I was wrong. I guess I do know that scripting is a huge part of it but I didn't expect it to be so hard to understand so I didn't allotted enough time into that area, but it still not too late to fix this issue.

Solution:

Go back and go through the Unity scripting tutorial and spend more time on the project each day and make sure that I really do understand the basic (because you can't advance with out the basic, it a building blocks). If self studying fail seek help!

Saturday, December 21, 2013

Winter break & Project start! Day 1

As much as I want to lay around and do nothing all break I promise my mentors that I will start and work on my space shooter. I should accomplished as much as possible while I still have the motivation to do so.

So today I started the project and pretty much setup the components:
-make material, script and  prefab base for all the main game objects

Material: Allow us to change the material / skin or the object different material will have different properties such as light refraction and how it interacted with other object. (today I only change color of each game object for easy identification)

Script: this is where you will use coding to basically give order to each object and tell them how to function.
Prefab: is like a storage for game object and it component. Once created it can be copy and reuse in any scene as many time as you like so it allow you to make copy of the original prefab and allow changes to be make to all copies of the prefab.

- next I did a little experimenting with particle system for creating explosion and for jet engine (might need help on this part)

this took about an hour normally setup wouldn't take this long but since this is my first full project I spend a lot of time experimenting with each option and make sure that I fully understand everything.

My current assets 
Here is my current asset my scene is empty right now since I make prefab for all my game object I don't need to leave them on the scene

I also learn to make simple sound effect with a simple sound program (link to site in the sources list) and how to import them on to Unity, but I think I will leave that for later because it more of a detail touch and not exactly needed for the game to be functional.

Thursday, December 12, 2013

No progress... & Plan of action

For the passed 2 weeks my mom is visiting from Thailand so I been spending time with her and honestly did not work on the project at all but I have make a Winter break plan of action and meeting with my mentor tomorrow to show him the plan and hopefully I will be able to stick to it and make some progress over the break and get back on track with the specification again.