iDevGames Forums
Create a simple 2d sprite based game - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Create a simple 2d sprite based game (/thread-7371.html)

Create a simple 2d sprite based game - Justin Brimm - Jan 27, 2003 11:06 PM

Cocoa : Objective-C

I want to create a simple 2d sprite based game (some drawn using pre-made images, and others made with a NSBezierPath, or anything else that would substitute), but I have no idea where to begin. I've created an NSView and made a custom class for it, but past that, I'm pretty much lost. I've done several tutorials before on drawing a sprite with NSBezierPath, but they never really help much in the long run.

Can anyone help me out? Tell me the steps I need to go through, and how I would go about doing them? (One thing I know I'm going to need a lot of help with is collision; not only will I have to do collision of round objects, but they will misshapen and such when you compress yourself to bounce around, making collisions even more difficult)

For the game (code-named and possibly permanently named: GOOP), your a green little blob of, well... goop. While your standing still or moving slowly, your gooey and stick to objects (floor, walls, ceilings, ect). In addition to that, you can compress yourself down smaller and propel yourself at high speeds, but at these high speeds, you become solid and act like a bouncy ball.

Your enemies are different colored balls of goop (like you), and your all competing for each others goop. You gain their goop by propelling yourself at them; if you hit them enough, you break through their membrane and get inside them, and devour them. You gain whatever abilities they had, and grow a little stronger and bigger. However, they too can do the same to you...

This is just a little game which I'm using to teach myself how to program a game in Cocoa (without any luck so far).

Create a simple 2d sprite based game - skyhawk - Jan 27, 2003 11:24 PM

how about you learn how to get key input so you can move around your sprite on screen

Create a simple 2d sprite based game - Justin Brimm - Jan 28, 2003 01:02 AM

Well, before I can do that, I have to learn an effective, clean and hopefully fast way of creating, drawing, maintaining and keeping track of sprites and a game world. Like I said, about the only thing I can do right is create an NSView and giving it a custom class.

Create a simple 2d sprite based game - Justin Brimm - Jan 28, 2003 05:24 PM

Well, if no one wants to post how too, is there any tutorials out there that can actually help, and not just give me a small part of a big picture?

Create a simple 2d sprite based game - Josh - Jan 28, 2003 08:57 PM

So basically what you want is someone to show you how to do sprite organization and making a sprite system? I am afraid I am a bit confused at what you are looking for. Collision detection? Physics? Images? I will try my best to help but I can't guarantee anything.

Create a simple 2d sprite based game - Chris Burkhardt - Jan 28, 2003 09:53 PM

Hello jbrimm, maybe the Cocoa Sprite Kit would make your life easier.

That is a cool game idea, by the way.

Create a simple 2d sprite based game - Justin Brimm - Jan 29, 2003 12:50 AM

What I need is like a guideline on how to tackle creating a game. Getting more in-depth than that, I need help on how I go about creating, drawing, maintaining, ect. sprites and a game world, and how I do things like physics, levels, and about everything you would expect in a game. My problem is, I don't know exactly how I should be doing stuff.

I have plenty of concepts of how to go about doing things, as a matter of fact, I have several concepts of how I could actually make parts of a game more complex while keeping the programming and structure simple, but getting that beginning base is where I'm stuck.

I have concepts of how to make layers for drawing in the game world, and how to handle sprites and many other things, but getting to the actual coding and maintenance of all that, is where I'm hanging up and getting stuck.

I don't know if any of that made sense, but I hope it did. Shock

Create a simple 2d sprite based game - OneSadCookie - Jan 29, 2003 01:54 AM

How about an introductory C book, or a few Cocoa tutorials if that's what you're into? I'm beginning to suspect that your issues are to do with lack of programming experience rather than lack of game-specific tutorials.

Create a simple 2d sprite based game - Justin Brimm - Jan 29, 2003 03:38 PM

haha... ya, a lot of both. I understand most of the code fine, I just have no clue where to tackle it. I can put together a simple sprite system on my own (among other things), but it ends up being an ungodly creation that is nearly impossible to use effectively.