Sign in to follow this  

How can I post a game?

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

here's the link. It's a 1.3 mb rar file

Clicky!

Anyways, I did some graphical work to try and determine what I want my character to look like (while animated)

Controls are as follows:

-standard 'wasd' keyset
-Left Ctrl attacks
-can use combinations of wasd to move diagonally (there's 8 directions total)
-tapping 'r' will make the character run, and tapping 'r' again will make him walk--you can do this repeatedly

so I have a couple questions:

1)if you mess with it enough you'll notice some flickering between animation frames. I'm not sure what's causing this, but I thought I'd ask

2) Say I wanted to add collision detection for only the sword. How would I go about doing that? Do I have to learn all that vector crap and see if the vector is in contact with an enemy?

3) isometric tiles.... I've done 2D before, but doing animations for isometric is something new. CAn you recommend anythign to help me make my tileset isometric (books, articles, anything)?

Thanks,

Massive-war

Share this post


Link to post
Share on other sites
Your character didn't show up until I pressed one of directional keys. At first I had thought it weren't working.

Quote:
Original post by massive-war
1)if you mess with it enough you'll notice some flickering between animation frames. I'm not sure what's causing this, but I thought I'd ask


OpenGL itself doesn't support VSync-ing, but one of it's extensions does. You may follow this link for an introduction of wglSwapIntervalEXT extension. For OpenGL extension manager, you may try GLee.

Quote:

2) Say I wanted to add collision detection for only the sword. How would I go about doing that? Do I have to learn all that vector crap and see if the vector is in contact with an enemy?


I guess it is the way to go, you may predefine sets of convex polygon with each sprite. They don't need to be extremely precise. For tutorials on 2D polygon collision detection, I find Oliii's tutorials suits your need.

Quote:

3) isometric tiles.... I've done 2D before, but doing animations for isometric is something new. CAn you recommend anythign to help me make my tileset isometric (books, articles, anything)?


You may find a lot on [google] with "OpenGL" "Isometric" "Tutorial" (sort of) keywords. JTippetts made a tutorial on this topic.

Share this post


Link to post
Share on other sites
Wow, that was all the information I need. Thank you skeleton.

As for the OpenGL part: I'm currently using only SDL. I guess I just wanted a basic animation system going so I had something to show in the minimal space.

I just dont' knwo what system to use. I mean, DirectX has so much stuff, yet it's so confusing to use in an actual game (in my opinion, but then again I haven't really worked with it). Is OpenGL like SDL where you basically use the API within the game, rather than use the game within the API?

Although, my guess is that DirectX is like beginning programming. YOu don't get good at actual game programming until you've actually programmed games, rather than reading books again and again.

Is DirectX really like that? Is it easier than it looks?

Massive-war

Share this post


Link to post
Share on other sites
Flicker can occur if you're drawing your SDL_Surface to the screen more than once per game cycle (note that I haven't checked out your executable, so I can't say with authority that that's what's occurring). Your main loop should look something like this (working from memory here since I don't have my code handy):
while (true)
updateAllObjects();
screen->drawBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0x000000); //Draw black box to screen
drawAllObjectsToSurface(screen);
SDL_Flip(screen);

Er, that's almost certainly wrong somewhere in there. But anyway, assuming you're using SDL_DOUBLEBUF, you should only be calling SDL_Flip once per main loop. If you call it twice (e.g. once after wiping the screen surface to black and once after drawing all the game objects) then you'll get flicker.

Share this post


Link to post
Share on other sites
I'm only calling SDL_Flip once per frame, however, I am drawing multiple things at multiple times. I like having my classes (well, objects) be able to handle themselves -- drawing, updating, etc.

So the player can draw itself, while the enemies can draw themselves, and only flip the screen once. I just call the update functions of each object in the main loop

Massive-war

(It's not flickering... it's just if you leave the animations go, once every couple seconds you'll see a second of flicker)

Share this post


Link to post
Share on other sites
Right, drawAllObjectsToSurface(screen) is just a function that calls each object's draw() function in turn.

Are individual animations flickering, or is it the entire screen? It's possible that you're just occasionally failing to call a given object's draw() function from time to time.

Share this post


Link to post
Share on other sites

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this