Whooohooo! I just had to do the programmer's cheer, but you know, not too loud. One must stay humble or the Programming Gods will smote you down.
Anyway, its been 100 days of actual work on my game. The journey has been long, but rewarding. I celebrated it yesterday night/this morning (what time is it?) by re-writing my OGL ES graphics engine and I kid you not, after a few compile and link errors, I told myself, "just kick that b*tch off and when it crashes, start debugging." To my amazement, I mean, that usually doesn't happen, it ran flawlessly (staying humble, I will check it out thoroughly later, make sure nothing is lurking to bite).
Also, this evening I finally got around to incorporating Lua into my project. I ran the obligatory "Hello, World!" script to make sure it was working and it is. Whooohooo!!
Now, for those who may still be trying or wanting to incorporate Lua into their projects and haven't been able to get it running or wondering where to start, well I will tell you here, because it wasn't easy for me, and I will try my *best* to make it plain and simple. Ohhh...I hate postings on the web where people leave out the little details.
Anyway, you will (oh yeah...this is strictly getting Lua to run in an xCode/iPhone project) need to grab, "lua-5.1.2(Xcode).zip" (now that I can't remember where I downloaded from since I downloaded it 2 months ago), but if you want it and can't find it, post a comment asking for it and I will email to you. So, the steps...
1) Get lua-5.1.2(Xcode).zip
2) Unzip it
3) It will unzip to the folder lua-5.1.2
4) Open it and double click on the lua.xcodeproj
5) Build the project (just to make sure it builds) ...it will generate a library file but don't try linking with it, too may hassles.
6) Copy the /Src folder from the Lua folder into your project. I created a "Lua," folder inside the "Classes," folder in my project and dumped it there.
7) Find in the /Src folder the files lua.c & luac.c and remove them (they both contain a "main," entry and will screw up the build).
8) Build your project to make sure things can compile (they should).
9) Create a file test.lua and type this in... print("Hello, World!") or whatever you want to print.
10) Copy the test.lua file to your project. I have a folder in my project GameResources, so I added a folder named Scripts and added my test.lua script there. Where ever you copy, just
remember to go to the Xcode menu, select Project and click "Add to Project," and navigate to "test.lua," or if you did create a folder to hold your scripts select the folder, and add it to your project. This will add your script to your Bundle.
11) Now find a file in your project, any one for now, since just testing, I placed my little test inside my view class. Add...
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
Since I wanted the code to just fire off, I added the following lines of code in the view class "initWithCoder" method.
lua_State* L;
L = lua_open();
luaL_openlibs(L);
// The "dofile," needs a path to our script. Well, the iPhone stores your data in the Bundle so
// you will need to grab the path to the bundle.
NSString* bPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"lua"];
// check to see if it was found, if not then you didn't add it to your project properly
if(bPath == nil)
{
NSLog([bPath stringByAppendingString:@"was not found"]);
// abort do something ...some real error handling...whatever
}
lua_dofile(L, [bPath cStringUsingEncoding:1]);
lua_close(L);
That's it..Build and Run...you should see your script write out to the debugger console. Good Luck!
Special thanks goes again to Chris Dillman who pointed me in the direction of including the script in my project, and telling me I needed to get the path to the Bundle. Also, Chris mentioned that each time you touch your script, you will need to clean the build in order for the changes to take place...I haven't actually tried that out to see.
Now...time to get some sleep.
Wednesday, June 10, 2009
Monday, June 8, 2009
Sunday, June 7, 2009
Some Right Brain Work
I completed the music for the game, when I figure out how to post it here, I'll put it up. A first snippet of my game. :)
Thursday, June 4, 2009
Easy As Pi
Big man crush for Apple. They make things so very, very simple. Pulled my iMac out of the box (which also is designed well), set it up in 5 minutes. Plugged in my external backup hard drive, and setup my new Mac with my old Mac's work folders, via TimeMachine restore. Viola! That was it...good to go.
Then, spent the next 2.5 hours downloading iPhone 3.0 SDK, and installing that.
Now, I'm up and running on a sanctioned machine..."doesn't it feel good to be doing the right thing, Rod?"
And, so that's what my game really looks like...since on the PowerPC the colors were funky. It is great to see things as they truly are, no more pointing out to my boys, "no, no that's not a green flying saucer, that is a red plate." Haaa haaa...now you think you have an insight into the game I'm making...whatever you are thinking the answer is nope. :) You will have to wait until it is near completion then I will post some screen shots and talk about the specifics.
Okay...my real job beckons.
Then, spent the next 2.5 hours downloading iPhone 3.0 SDK, and installing that.
Now, I'm up and running on a sanctioned machine..."doesn't it feel good to be doing the right thing, Rod?"
And, so that's what my game really looks like...since on the PowerPC the colors were funky. It is great to see things as they truly are, no more pointing out to my boys, "no, no that's not a green flying saucer, that is a red plate." Haaa haaa...now you think you have an insight into the game I'm making...whatever you are thinking the answer is nope. :) You will have to wait until it is near completion then I will post some screen shots and talk about the specifics.
Okay...my real job beckons.
Wednesday, June 3, 2009
The Arrival
Noooo, noooo...the game isn't finished yet.
I'm just announcing the arrival of my new iMac. So, now I will be legit. I dubbed thee, Hitchcock. My other Mac is Shyamalan.
Alright...back to real day job work, but tonight...I'll be running my fingers across Hitchcock's keys...ooohhh you're so nasty.
I'm just announcing the arrival of my new iMac. So, now I will be legit. I dubbed thee, Hitchcock. My other Mac is Shyamalan.
Alright...back to real day job work, but tonight...I'll be running my fingers across Hitchcock's keys...ooohhh you're so nasty.
Tuesday, June 2, 2009
There Are No Problems, Just Solutions
There is no problem with the way my artist is doing transparency. Thanks to Cara Motycka, Gyuri Grell, and Chris Dillman for looking at the art and pointing me to a tutorial. Turns out my artist had already read the tutorial that Gyuri mentioned, and Cara & Chris looked at the sprites and said they were correct.
So, what's the problem you ask. The answer, and as Dave Chappelle would say, "it pains me to say it people," is either my blending code ("noooooo!" the chorus roars) or the fact that I'm running on a non-sanctioned PowerPC Mac and the color/alpha scheme is funky. RGBA on the PowerPC is GRAB, so things may be working but the hardware is showing me differently.
Also, Chris pointed out to me that my converting the PNGs to PVRTC may also be stripping the alpha out. He told me to just stick with the PNGs. The curious thing is that in the funky GRAB scheme, I found some sprites online that did alpha blend for me. Only the ones with black backgrounds worked though. So, who knows...
When my new Intel based iMac arrives (hopefully this week), I will find out if its me or the machine.
Thanks again to those dear souls that helped me see error of my ways. :)
Gyuri is already receiving a free copy of the game for being the first to answer some previous question I had, and now Chris and Cara will as well. Also, here's a plug for Chris, buy his game "Mouse House, " that is already up in the iTunes store.
Now, back to work.
So, what's the problem you ask. The answer, and as Dave Chappelle would say, "it pains me to say it people," is either my blending code ("noooooo!" the chorus roars) or the fact that I'm running on a non-sanctioned PowerPC Mac and the color/alpha scheme is funky. RGBA on the PowerPC is GRAB, so things may be working but the hardware is showing me differently.
Also, Chris pointed out to me that my converting the PNGs to PVRTC may also be stripping the alpha out. He told me to just stick with the PNGs. The curious thing is that in the funky GRAB scheme, I found some sprites online that did alpha blend for me. Only the ones with black backgrounds worked though. So, who knows...
When my new Intel based iMac arrives (hopefully this week), I will find out if its me or the machine.
Thanks again to those dear souls that helped me see error of my ways. :)
Gyuri is already receiving a free copy of the game for being the first to answer some previous question I had, and now Chris and Cara will as well. Also, here's a plug for Chris, buy his game "Mouse House, " that is already up in the iTunes store.
Now, back to work.
Monday, June 1, 2009
Doin' The Cha-Cha!
Yesterday a took a step back to clean up some things. Today some steps forward...cha-cha, cha-cha.
I'm proud to announce that I'm now up and running in my own project. I've started laying out my different component classes (yes I am big on Design Patterns). Ahhh...it feels great to be in an organized environment.
I will continue on.
One draw back. My artist is still having trouble creating transparent sprites with Illustrator and Photoshop. I keep getting things that aren't transparent at all, or half of the sprites are transparent.
Call for help...if anyone out there knows how to create transparent PNG images in Illustrator and/or Photoshop please drop me an email.
Thanks!
Now back to work...
I'm proud to announce that I'm now up and running in my own project. I've started laying out my different component classes (yes I am big on Design Patterns). Ahhh...it feels great to be in an organized environment.
I will continue on.
One draw back. My artist is still having trouble creating transparent sprites with Illustrator and Photoshop. I keep getting things that aren't transparent at all, or half of the sprites are transparent.
Call for help...if anyone out there knows how to create transparent PNG images in Illustrator and/or Photoshop please drop me an email.
Thanks!
Now back to work...
Subscribe to:
Posts (Atom)