PDA

View Full Version : Re-making games purely in OSX


DeputyDoofy
2007.07.02, 05:43 PM
Ok, for the most part, I've got the game design thing understood. I've made my own javascript version of Tetris (http://mywebpages.comcast.net/skull2k5/scriptris2_0.html) and I'm interested in re-creating it using Objective-C. More times than not, my biggest issue is learning the IDE and API's to make my idea possible. The programming skill is there for the most part. Is there a good way to make some kind of sprite-collision detection (without using someone else's)? This is where I always get stuck when wanting to make an OS X game. Thanks.

unknown
2007.07.02, 08:17 PM
For tetris I (http://fax.twilightcoders.net/Tetris06/) would just have a grid of cells with on/off states (on if a block in that cell) and check if you would be putting a box in an already occupied cell (x, y) by moving it down, if so you know that a collision has occured.

DeputyDoofy
2007.07.02, 11:55 PM
Ok, that answer is fine, since that's how I did my javascript version. Thing is, I can create the array if I read up on objective-c. How do I actually draw the 2D grid? I never quite find a straight-forward answer on 2D graphics. I'm not even going to try 3D. :blink:

unknown
2007.07.03, 03:43 PM
Create an NSView and draw an NSImage with compositeToPoint:
You can learn about drawing graphics in Cocoa with Quartz from for example, http://cocoadevcentral.com/d/intro_to_quartz/

DeputyDoofy
2007.07.04, 06:16 PM
Oooh. Appreciate that link. Will have to read up. Thank you much! :)