Redirecting you to bearmacstudios.com.... BearMac Studios: Scripting

Pages

Showing posts with label Scripting. Show all posts
Showing posts with label Scripting. Show all posts

Monday, February 20, 2012

Future Features!

This has been keeping me up all night, so just to get my thoughts down I'm going to write this out.
What I plan to add in the near future:

  • Save System
  • Point System, or Story line?
  • More Puzzle types
  • Rigid body movement?
  • switches and what not
The thing that's been keeping me up has been the save system. I have a sort of Idea of how to tackle this, but here it goes. I'm going to use the playerprefs class to save an integer, this integer will be directly linked to the level completed. So by this method I will be saving only one variable, and in between maps. For instance;

Player clicks "Load Game"> Level Completed variable = 2 > load second level. 
or
Player clicks "Load Game">Level Completed variable = 0 or null > Display message "No Game Started"

My problem is that I don't want a million loading screens for every time in between levels, so I need a variable that won't change in between levels and every time a level is completed it will add one to the Level Completed variable which is saved by the playerprefs class, but I'm getting tired so now my brain is wandering to new problems that didn't exist before, and probably won't exist in the morning. So I say to everyone reading. Goodnight, and also, thanks. ;)

Sunday, February 19, 2012

Saturday, February 18, 2012

Pre-demo Update

So before I showed a demo video I wanted to add more to the game. So here's just a brief overview of what I added:

  • Footstep Sounds (Randomly played from array)
  • Jump Sounds(Random)
  • Rushing wind effect when falling at high speeds
  • Title Menu
  • Pause Menu
  • Reset Level button
  • Better power-up pick up physics
  • Last but not least, an objective!
So those are just a few of the things I have added over the past couple of hours, hopefully sometime during the week I can get a little demo uploaded to my youtube, but for now keep an eye out for it on my youtube channel!


Thanks,
          -Hunter

Thursday, February 16, 2012

Pause Menu Tutorial!




Here it is guys! I'll be uploading our Demo here soon, so keep an eye out for that! Thanks to all of you that watch!

Pause Menu Script!

Here's a script that's extremely similar to the main menu script. It's for the pause menu in the tutorial that's on YouTube right now!

var menuHeight:float=500;
var menuWidth:float=500;
var buttonSpacing:float=25;
var mainMenu: String = "MainMenu";
var titleTexture:Texture2D;
var customSkin:GUISkin;
var customStyle:GUIStyle;

function OnGUI(){
GUI.skin = customSkin;
GUILayout.BeginArea(Rect(Screen.width/2-menuWidth/2,Screen.height/2-menuHeight/2,menuHeight,menuWidth),customStyle);
GUILayout.Space(50);
GUILayout.Label(titleTexture);
GUILayout.Space(buttonSpacing);
if(GUILayout.Button("Main Menu")){
Application.LoadLevel(mainMenu);
}
GUILayout.Space(buttonSpacing);
if(GUILayout.Button("Exit to Desktop")){
Application.Quit();
}
GUILayout.Space(buttonSpacing);
GUILayout.EndArea();
}

Thursday, February 9, 2012

Woah! two videos in one day!

I uploaded another video today. it's a tutorial. great learning experience. You guys must think I'm crazy with two videos within the same day! so take a look and enjoy! I'll be uploading the full script as soon as we get it finished! if you comment and stuff like that it encourages me to continue my work and it helps me out a lot!


New Project!

Here's an extremely small demo of our first project. it's just a couple hours of work. I learned a lot by making this, and  I will be making a tutorial on the Time class in unity. Let me know what you think and throw requests out there if you can! Thanks!



Oh yeah and the sounds are all from freesounds.org
Great place to go for, well, free sounds! Go ahead and check that out and if you'd like anymore info post a comment on here or on youtube!

Thursday, February 2, 2012

Tutorial Part 2


In this we start our script for the main menu on a blank scene. Everything from here on out will move pretty quickly and smoothly. Just wait for the next episode coming soon, and the pre-made MainMenu script will be uploaded shortly after this post. Feel free to use it, it's not too complex so you don't need to give credit, though it would be nice ;)

Wednesday, February 1, 2012

The title screen  for my new project, it's a zombie from the unity asset store falling into a spot light....
The camera has a wavering animation ping-ponged and looped. It's all in Slow-Motion with Rain falling. In the background some ethereal piano is playing, along with the sound of rain falling....
Let me know what you guys think! Video soon!

Tuesday, January 31, 2012

Intro To My First Tutorial!




I'll upload the full scripts after the second part, maybe a project file. Let me know what you guys think and what direction I should go next. Thanks!

Friday, January 27, 2012

Quick help with understanding UnityScript

In a UnityScript script you will see something like this :
gameObject.GetComponents("MyScript").BooleanVariable = true;

Now for the people who look at that like "wtf?"
Here's a simple way to understand that;
Say I need Unity to find my computer and turn the power buttton to on, in a Java or UnityScript environment I would tell unity
MyHouse.MyRoom.Desk.Computer.PowerButton = on;

So to access a script named PowerButton on a gameobject named computer and change the Boolean variable powerButton to an on state we'd approach it like this;
GameObject.Find("computer").GetComponent("PowerButton").powerButton = true;

I saw this explanation awhile ago and it really helped me teach myself how make things happen in Unity.