Monday, March 28, 2011

Alien Artifacts Full Screen Inventory GUI

I made a background image for my FPS game where my character "Farmer Bob" has to collect 4 "Alien Artifacts" that he will find lying about either after something has happened in a game level or somewhere inside the game level. Once "Farmer Bob" has all of the "Alien Artifacts" they will enable him access to or be able to do something special with them. Right now I'm looking into how to make this function inside of my game environment. I currently have it set up as a full screen GUITexture object with this code attached to it:
function Update () {

transform.position.x = 0;
transform.position.y = 0;

guiTexture.pixelInset.x = 0;
guiTexture.pixelInset.x = 0;

guiTexture.pixelInset.width = Screen.width;
guiTexture.pixelInset.height = Screen.height;
It's a simple code, the same one I'm using for my Full Screen blood effect for when my FPS player takes damage. Now what I need to figure out is for when my FPS player picks up an "Alien Artifact" it will get added into this inventory screen into one of the place holders I have set up here. My guess is, is that I would make a smaller GUITexture to represent each "Alien Artifact" and then somehow have the code place those "Alien Artifacts" into the appropriate spot on my inventory screen in order of how "Farmer Bob" collects them up. I then somehow have to make sure that, that game information is carried over from level to level as my player moves between them. I've not yet figured out or decided whether or not to have my character go back and forth between levels yet. I'm thinking yes! Because it might make the game more challenging if "Alien Artifacts" and other game objects are missed, then he would need to return to either find them or pick them up.
All this and I STILL have NOT been able to get my stupid Alien Zombies to attack my FPS player. Grrrr...

No comments: