Chunky by FelipeFS
Chunky by FelipeFS
GPWiki.org
It is currently Wed Oct 22, 2014 7:58 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Thu Apr 27, 2006 9:39 am 
Rookie

Joined: Thu Apr 27, 2006 8:13 am
Posts: 1
Location: St. Poelten, Austria
Hi!

I'm fairly new to game programming. Before beginning to program I decided to design a framework for 2D action games with UML.

This is the "small" version:
Image

Here is a (really!) big version for the details.

I'm really doubtful if this design is the right one. It looks far to complicated for simple games like a Pong-Clone. In the future I want to adapt it for much more complicated games like a North-and-South-Clone (http://hol.abime.net/995).

Maybe I should explain some things:

*) TheGame is a (singleton) class. It contains the eventloop, which calls methods of the GameController which decides what to do when a specific event (like the "A"-Key has been pressed) arises and methods of the TimeSubject which tries to keep the framerate constant (in pattern language it's implemented as an observer which calls the "tick()" method of objects that are dependend on time).

*) I tried to use EventDriven Programming for game logics. Each part of the game communicates through messages to the gamelogics.

*) An interesting part could be the Rendering of Sprites since Animations are bound to the different states of a game character (like the ball in the example). The rendering itself happens through the RenderManager which gets the surfaces to blit through a character which gets the current surface through it's state subsequently.

*) I'm a bit unsure about the collission detection. At the moment it's bound to the states of characters since it's depending on the current animation.

What do you think about this design? I'm currently still looking for literature on designing 2D sprite based games with OOP. Up to now I only found literature that was (IMHO) written for academic purposes only ("Patterns in Game Design" specificly).

Thanks for reading and looking :)
Rainer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 2:34 pm 
Funky Monkey
User avatar

Joined: Sun Aug 15, 2004 1:07 pm
Posts: 1617
Location: Atlanta, GA
If you're fairly new to game programming your headed in the right way with such a good design as it's hard for me to just sit down and design by myself. In a group it's much easier, but indie, it's hard.

From the looks if it looks like it's pong, but i could be mistaken(all i see are the ball paddle things etc...). Atleast some game with some paddles, possible objects in the way(walls), and balls that will be hit around.

If you want some books, check out amazon.com and look at "Game Programming All in One" and "Data Structures for Game Programmg" those are excellent books that stay in the 2D realm, both(atleast one use SDL), can't remember exactly cause bought them awhile ago.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 3:54 pm 
Also known as "Lucky"

Joined: Sat Aug 07, 2004 9:22 pm
Posts: 5853
Location: Vancouver, Canada
Hi dubbaluga; welcome to gpwiki :)

I think the fact that you're planning ahead is a good sign, but be aware, you will always have missed something, and your design will have to evolve as you begin to implement it. Don't get to attached to it! However, as I said, having a plan is better than not having one, so I think things are looking good for you :)

Good luck! If you have any implementation problems, we're here to help.

_________________
FizzBall, Professor Fizzwizzle, The Amazing Brain Train, and My Tribe!


Top
 Profile  
 
 Post subject: Good Design!
PostPosted: Sat Jul 08, 2006 10:14 pm 
Rookie

Joined: Sat Jul 08, 2006 9:20 pm
Posts: 1
You are light years ahead of many, since it's difficult for some of us to do those designs before diving in to code.

Go with that design. It can take you far.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 10:18 pm 
Digerati

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1816
Location: burrowed
Quote:
http://hol.abime.net/995


omg i LOVED that game

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 10:54 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Tue Jun 13, 2006 11:51 am
Posts: 547
Location: Right here
to tell you the truth, i don't see how diagrams would help you much when programming a game. for me all the stuff in your diagram i already have in my head when i when i start programming, and i add stuff whenever i think of it; this way i don't have to rewrite any diagrams because it was all in my head to begin with.

and i didn't know that 'north and south' was that popular of a game, i thought i was the only one that liked it! the battles are the best


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 10:59 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Tue Jun 13, 2006 11:51 am
Posts: 547
Location: Right here
also, think of all the time you spent making that diagram, when you could have spent it coding.

i mean if it works for you, then its ok. but for me it would probably take me an hour+ designing a diagram. and then i wouldn't use it anyways because i made it, so i know everything it says already.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 11:02 pm 
Digerati

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1816
Location: burrowed
you know that there is an edit button mr, do you :P
:ego

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 11:09 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Tue Jun 13, 2006 11:51 am
Posts: 547
Location: Right here
i like the double emphasis that its me talking :O


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 11:10 pm 
Digerati

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1816
Location: burrowed
post++;


:P


edit: i dont like diagrams like that aswell... im doing that kinda stuff in my mind like cottonboy :)

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 11:29 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Tue Jun 13, 2006 11:51 am
Posts: 547
Location: Right here
weezl wrote:
post++;


i'm going to program my entry for the coding contest in post++ :rolleyes


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 09, 2006 3:05 pm 
Bibliotherapist
User avatar

Joined: Wed Dec 21, 2005 6:23 pm
Posts: 6210
Location: Manchester, UK
I don't mind that kind of diagram.... but that one seemed to be a bit too complicated for what it showed. To me, a class diagram is for straightening things out in your head before coding. If things are already straight in your head, don't bother doing a diagram, and if they aren't only do a diagram up to the point where it is straight. It will change as you code and see things that are wrong anyway. If you want a completely accurate diagram, get it all programmed and then run a UML tool that will create a diagram from source code. There is a name for the process of getting every single detail sorted.... programming :P

_________________
God must love stupid people, he made so many.
theraje: 'God doesn't love stupid people, they're just easier to make'
http://sharedillusions.blogspot.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group