PDA

View Full Version : My Various Programs


Nick
2004.10.27, 03:40 PM
I was wondering what people thought of the few things I've done.

Here's what I have. Click here to go to the site to download them. (www.angelfire.com/indie/simreality/projects.html):

1) Color Previewer: Cocoa and OpenGL. Simply move the sliders to change the colors. Text boxes give you the various types of numbers (int, float, percent) for each part (r,g,b). You can also change the color of the background behind the box to compare it to either black or white. Pretty simple. My first mix of Cocoa and OpenGL.

2) Sidescroller Engine: SDL and OpenGL written in C++. Basic little sidescroller engine. Use the left and right arrow with the cmd key to move and jump. Pressing esc quits and 'r' resets the game. Going for a classic Mario type gameplay. Some collision problems and other glitches. Also in the .zip package are XML files for the levels. Feel free to edit the levels if you want. It will only read the three levels that are there but you are more than welcome to make them longer, shorter, or full of stuff.

3)Punch Everything: My Cocoa whack-a-mole type game. Pretty amusing. My only finished game to date. Just start a new game and click the moles. Simple, huh?

Let me know what you think about these three programs. I could obviously improve my color program but I only made it to get used to Cocoa and OpenGL. The sidescroller engine may find use later but for now has been shelved. Punch Everything is done. Unless I find bugs or get really bored I doubt I'll do much with it.

arekkusu
2004.10.27, 04:27 PM
1) doesn't run, turn off zerolink
2) doesn't run, bundle SDL.

3) In general, I think this is a pretty good little project. Just about right for learning your way around Cocoa. My criticisms are:
* it uses 100% of the CPU. This is unacceptable. Are you in a while() loop?
* this is the rare exception where a window border is a good thing. Delineating the clickable game area (for example with an NSBox) would help users see where "out of bounds" clicks are. And making the border around that area a bit bigger would help avoid clicks on the Desktop/other apps as you are wildly mousing around.
* for both game and learning purposes, it might be nice to have sound effects.
* the copyright is in the about box, no need to put it in the main window too...

Nick
2004.10.27, 04:48 PM
I've been working on bundling SDL but apparently I failed.

The clickable game area is not laid out because the moles are actually buttons without borders that gain an image when they are the mole and lose it when they are not. I guess I could surround the buttons with a box. I'm not in a while loop. Just an NSTimer that calls a function with a couple if statements.

I've uploaded a new version of the Color Previewer with zerolink disabled.

PowerMacX
2004.10.27, 06:04 PM
I've been working on bundling SDL but apparently I failed.

Just put it inside a Frameworks folder inside your app package (check any other SDL based game out there to find out where exactly, I'm not in my Mac so I'm not sure if it's just in Contents or somewhere else...)

Nick
2004.10.27, 06:37 PM
In Xcode would that be the 'Targets' item in Groups & Files? Under the frameworks & libraries item is SDL and SDL_image along with Cocoa and OpenGL. I'm not sure what else to do. I also have them in the Resources->Frameworks->Linked Frameworks folder.

arekkusu
2004.10.27, 06:46 PM
Outdated, but this tutorial (http://www.cocoadevcentral.com/articles/000042.php) shows what to do.

igame3d
2004.10.27, 06:51 PM
Can't acces the color previewer, angelfire missing page error

You should write a tutorial for this site for that punch thing, its simple, very, and would be actually something easy to sit through compared to that boring stuff Apple's dev site provides.

Nick
2004.10.27, 07:00 PM
I did write a tutorial a while back. It's on my home page (Here (http://www.angelfire.com/indie/simreality)) and I actually gave it to Camacho who was going to edit it and host it here. I'm not sure where he's at with it (he is a busy guy so I'm not worried) but I'm sure it'll get done at some point.
I guess the thing about the game is that it uses buttons for all pictures including things like the miss X's just because I knew how to use them for images. I guess I could (and should) recode it with image boxes for the misses and the game over text but at the same time, I'm not sure it'd be worth it. If anybody else wanted to I could give you the project and you could do with it as you wish.

I'll check on the color previewer problem now. Probably a new file name since I uploaded it again.

As for bundling SDL, I'm not sure how to open the SDL framework in Xcode besides copying it in. I can't seem to figure it out. I'll keep trying but if anybody knows, please let me know.

igame3d
2004.10.27, 07:25 PM
I did write a tutorial a while back. ...... and I actually gave it to Camacho who was going to edit it and host it here. I'm not sure where he's at with it (he is a busy guy so I'm not worried) but I'm sure it'll get done at some point.


That could be several people's signature around here.

You listening Carlos? put the f*&!@%&# TUTORIALS UP before you lose them to another hard drive crash like all the other ones you sat on for god knows how long.
We'll deal with typos when we find them, isn't that what we have OneSadCookie hanging around for?

I downloaded all your tutorials a few weeks ago actually, now where the hell did I put them?

Is the Color Gizmo thing in the tutorials too? Thats another fairly simple learning experiment that is ever so much more interesting than oh say Currency Convertor (blegh!).

igame3d
2004.10.27, 07:27 PM
Check your filename on the color thing again, it wants to download as .app, and safari wants to add .txt to it. Weird.

Guess you need sleep. :wacko:

Nick
2004.10.27, 07:27 PM
I guess I could make a tutorial for the Color thing. It'd take a few days but I'll post back when I get it.

I took care of that problem. Not sure why it wanted to add .txt to it so I just made it a .zip file. All set now. Any more problems with downloading or opening that one?

arekkusu
2004.10.27, 09:19 PM
1) runs now. Not much to say about it, but:
* uses 100% CPU. What are you doing in your event loop? You should only repaint the view in response to user action.
* the window is too big to fit on some displays (800x600 iBooks, for example) and isn't resizable.
* the UI is fairly disorganized (alignment, inconsistent font size, usage of white space...)

Malarkey
2004.10.28, 03:04 PM
3)Punch Everything: My Cocoa whack-a-mole type game. Pretty amusing. My only finished game to date. Just start a new game and click the moles. Simple, huh?


Hey, you can try adapting this whack-a-mole game into something like this (http://www.eyemaze.com/tontie/v1/index.html). Don't forget to turn on numlock if you're viewing this on a PC.

Nick
2004.10.29, 12:25 PM
(check any other SDL based game out there to find out where exactly,

Does anybody have any SDL based games in an Xcode project file that I could see?

I also added a new file to my page. My new game Tank Arena. I remembered a simple Atari game I used to love and so I'm making a humorous tank game. Right now there's not much to it. One player is controlled by the arrow keys and return. The other by WASD and shift. They just drive around and shoot. I plan to add some barriers and lives and such for a multiplayer fun time. Then I want to add some simple AI and some larger levels (multiple screens with smooth scrolling) for a 1 player mode. Then after that I'll add some network support to get into that whole thing. I'm wondering if SDL is bundled in it correctly now. I think I got it but again I'm probably wrong.

Here's the link: http://www.angelfire.com/indie/simreality/projects.html

sealfin
2004.10.29, 02:43 PM
Does anybody have any SDL based games in an Xcode project file that I could see?
Yes (http://www.sealfin.com/rants/index.php?p=9).

Nick
2004.10.29, 02:48 PM
Thanks a ton. What do you think of Tank Arena so far? I plan to make the tanks explode apart into various squares when they are shot as a cool effect (inspired by Dr. Cote).

ps I've uploaded a new build of Tank Arena with yet another try at building it with the framework. Someone let me know if it does not.

sealfin
2004.10.29, 03:49 PM
Well, it launches on my system, but I've got a local copy of SDL; I'll quickly check...

No, there's no Frameworks folder in the bundle - you need to either create that folder and copy the framework into it by hand, or (preferably) open the "Targets" tab in Xcode and create a new "copy files" build phase, with the copy destination "Frameworks", and put a copy of the SDL framework there.

I had to force quit your game, as it hides the cursor (and Apple-Q doesn't work, but I know that's SDL's fault.)

Nick
2004.10.29, 04:46 PM
Sorry I should've mentioned that esc quits. My mistake. I do have a copy files build phase but i don't think my destination is correct.

I've fixed it I think so try it now (if you'd be so kind).

sealfin
2004.10.29, 05:22 PM
Yep, the Frameworks folder (and SDL within it) are now present in the bundle.

PowerMacX
2004.10.29, 06:26 PM
Does anybody have any SDL based games in an Xcode project file that I could see?

Yes, I'm updating some html in my site right now, but in the meantime check my older site at www28.brinkster.com/ignacio3d (http://www28.brinkster.com/ignacio3d) (the downloads section has binaries, the developer section has source code)

A little warning: you're not going to learn how to bundle SDL correctly by looking at my Xcode project, because I bundle SDL the "wrong" way.
- The way I do it, is to build my project ("Release" target), and then in the Finder, I open up the package, and inside the Contents folder I create a folder named Frameworks and copy the SDL framework in it. This works fine (case example: Okugai)
- The "right" way (I think), is to add a "Copy files" phase to your target, and set it to copy the SDL framework to the right place when you build it. This also works fine.

EDIT: Hey! This thread had two pages! Everything I said above is sort of redundant now :blush: ...