• Content count

  • Joined

  • Last visited

Community Reputation

106 Neutral

About DFPercush

  • Rank
  1. Game Maker, Unity, or Blender?

    If you're not planning on selling it or learning how to use a traditional programming language, you might consider Epic's UDK (Unreal Tournament engine). People actually get hired for this, so it's not completely esoteric. It will introduce you to a lot of the concepts of modern 3d games, and if you choose, you can learn how to do it in OpenGL with your own code later. But you'll need 3ds max or Maya to go with it. As for the choices presented above, I'd say Blender, mainly because you can extend it with Python code and it's free. But that's coming from a programmer. Blender is pretty intimidating, but very powerful. I'd like to see more done with its game engine, if anyone ever manages to figure it out lol.
  2. I learned C++ and SFML, What now?

    I actually got into game programming by learning how "Metroid" worked. Not the best example for a pc-based modern game though. As far as 2d games go, it's a lot easier than 3d, so that's one advantage of starting with a breakout game. Basically you're dealing with sprites, and backgrounds which are just bigger sprites that get drawn first. A 2d "map" is usually represented by an array. You can make it a static 2d array like map[100][100], or you can make it a 1d and use math to figure out how to translate from 2d coordinates to a 1d array offset: [source lang="cpp"]offset = (coordY * width) + coordX; [/source] Each element in the array would be a tile number, and you could then render the image for that tile to the screen. Put that in 'for' loops for x and y and you've got yourself a map. For ease (not so efficient) you could just store a separate sf::Image for each tile. I'm not sure if SFML lets you render only part of the image or not, but what I've done in the past with DirectDraw (before it was obsolete) and windows GDI, was to basically have a "tileset" image divided into a 16x16 grid of tiles. Then you c an find the x/y coordinates of the tile you want within the source image by: [source lang="cpp"]sourceY = int(tileNum / tilesPerRowInSourceImage) * tileHeight; sourceX = int(tileNum % tilesPerRowInSourceImage) * tileWidth; [/source] Of course that's limited to 256 tiles, but you can make the dimensions larger. If you're using openGL textures though, you want to make your source image size a power of 2 or certain drivers might try to do a messy resize on it. I usually reserve tile # 0 for transparent. One caveat is that certain image formats and GL textures put the origin (0,0) at the bottom-left of the image, while some systems start at the top left. If that happens just use (height-y) obviously. Not sure about SFML, I'm just starting to learn that myself. There's a free program called "Mappy" that might be good for designing your levels. That will give you some test data to work with at least. It can save a raw format that you can just binary read into your map array. It's based on that second approach where all the tiles are stored in a single image. One major hurdle to overcome is how to handle collision detection. There are math formulas on the internet for this, if you know the right math jargon to look for. You'd probably want something like "line segment intsersect test". There's one that can tell you the exact coordinates where it intersects. I like it better than a simple yes/no test because it lets you get right up to the edge. What I did once upon a time was to loop through all the non-zero tiles on the screen, and for each edge of the tile, figure out the x/y coordinates of the line that represented that edge. Then calculate the line segment from the current position to next frame position of the ball, and see if these intersect. (Edit: This can be optimized by only looking at tiles which are near to the ball. You can also eliminate half the edges by paying attention to the velocity of the ball. if it's traveling right, you only need to check the left edges of tiles, and so on.) As for classes, it's really not necessary to make it fully OOP, but it wouldn't hurt to learn how to make a proper OOP project. I would at least have a class for the paddle or "Vaus", maybe one for user input cause you want to store the state of the input devices every time you get an input event from SFML, and probably one for the map. If you can manage to display a basic tile map I think you'll start figuring the rest of it out from there. Good luck! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]