Re-making games purely in OSX

DeputyDoofy
Unregistered
 
Post: #1
Ok, for the most part, I've got the game design thing understood. I've made my own javascript version of Tetris 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.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
For tetris I 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.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
DeputyDoofy
Unregistered
 
Post: #3
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
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #4
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/

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
DeputyDoofy
Unregistered
 
Post: #5
Oooh. Appreciate that link. Will have to read up. Thank you much! Smile
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Newcommer wanting to start making games help? Rampage 2 3,940 Nov 18, 2008 04:39 PM
Last Post: stevejohnson