Hi all,

I have been started to learn game programming for some weeks.
I want to make a simple 2d game first, as a start off.
but I come across some trouble~they are:

I tried C++:
allegro : maybe too primitive and old?
Irrlicht: 3d rendering concept too complex for me (now), not understand the whole bunch of scenenode, scenemanager, mesh, meshbuffer things. I don't think I am ready.
Ogre : too complex even to install. I compiled ogre from source myself once, but cannot link ogre with a new project. damn.

I tried python:
pygame: the documentation of it and python sucks. For example, a class in pygame is pygame.sprite.Sprite, the doc explained its method available, but doesn't tell me its attribute, what is it about???


Java.....I wouldn't consider it because it is just too slow.

C# and silverlight.....does it have a future for game programming?

Flash.......doesn't even have a tool to write it (adobe flash require money). However I am interested to make some game like bejeweled, they are awesome.

Objective-c : popular for iphone game, but I don't have a iphone and don't have a mac book, so it is already banned

End up I think C++ is the most appropriated language which have great documentation and many active support from the internet. Can anybody suggest some idea for me in this way? Do you think allegro is a way out?

I would be really appreciate for any help. Thank you all!

Dani AI

Generated

A practical path for a first 2D game: pick a very small, finishable target (Pong, Breakout or a single-screen match-3), then implement it in tiny steps. The thread lists many libraries and languages; rather than switching stacks, focus on the core systems in this order: game loop (fixed timestep), input, rendering, simple collision, state management, sound and then polish. If the goal is low-level C++ learning accept extra tooling; for fast iteration prototype in a higher-level language. Heavy 3D engines add complexity that isn't needed for 2D.

Clarification about pygame.sprite.Sprite (addresses the original PyGame confusion): Sprite is a tiny convenience class. Groups that draw sprites expect each sprite to expose an image surface and a rect; any other attributes (speed, health, etc.) are user-defined. Runtime inspection is useful: dir(obj) or vars(obj) shows attributes. A minimal pattern:

import pygame

class Player(pygame.sprite.Sprite):
    def __init__(self, pos):
        super().__init__()
        self.image = pygame.Surface((32,32))
        self.image.fill((200,30,30))
        self.rect = self.image.get_rect(topleft=pos)
        self.speed = 200  # px/sec
        self.health = 3

    def update(self, dt):
        keys = pygame.key.get_pressed()
        if keys[pygame.K_LEFT]:
            self.rect.x -= int(self.speed * dt)
        if keys[pygame.K_RIGHT]:
            self.rect.x += int(self.speed * dt)

# main loop: dt = clock.tick(60)/1000.0

Practical tips and next steps: use placeholder rectangles/art first, keep assets small, draw collision boxes to verify detection, commit code to source control, and break features into the smallest possible tasks. When performance or distribution becomes important, port the prototype to a C++ library (lightweight frameworks work best for 2D). Several replies here (for example , and ) list libraries and tutorials — treat those as options but let the goal of shipping a tiny game decide the choice.

Recommended Answers

All 11 Replies

I'm not sure myself but I'm trying to work on a game like that myself.
I sent you a Pm about something also.

I think allegro is a good place to start. It's fairly primitive, but it should be advanced enough to make some good little 2D games, as long as you know what your doing with it. Not sure what you mean about PyGame not being documented very well. There are loads of examples and a full documentation of all the functions. I got along fine with it, and I'm now using PyOpenGL with it as well.

Well for me i think allegro also is the best game programming and i agree with SgtMe" suggestion!!

:D Please upvote my post then and mark the thread as solved. Thanks :)

For me, It's allegro...and because a lot of tutorials and online forums are scattered over the internet...

It's also a beginner friendly tool...

you can go here:
www.moosader.com/

and here

most of their discussion are about Allegro and SDL...

Goodluck! :)

I would try using SDL. I use it and, it has many functions including detecting mouse and keyboard activity, multithreading, alpha blending, .ttf text, and audio.

For simple but excellent tutorials on how to get it, use it and, make games with it check http://www.lazyfoo.net/SDL_tutorials/.

These tutorials show you all of the important parts of SDL and many cool tricks you can do with it.

Have fun! :)

just stick on c++ or python

I would say go with allegro.
Also i will suggest Sudo Bash's comment.
Vinayak

You say you didnt even consider java because its too slow however by using multiple threads you would be able to make an efficient game. games such as Runescape and minecraft (two very successful games) are programmed in Java. Java is used in many business arenas as it is cross platform and by configuring the JRE carefull you can create a very fast application.

Im also interested in developing a 2d game. can anyone let me know how it can be done and what us the process

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.