Jump to content
  • Advertisement

Pedro Candeias

  • Content Count

  • Joined

  • Last visited

Community Reputation

103 Neutral

About Pedro Candeias

  • Rank
  1. Pedro Candeias

    Help a beginner

    Hey, My advice to you would be not to rush things. Stuff like DirectX and OpenGL should only be attempted in my opinion after a few 2d games. So my advice would be to try and get SDL or Allegro to work. They are both good tools to get your 2d game going. However, if you just want to practice the project management part you could even try text based games. This tutorial should help you set up SDL regardless of your IDE : http://lazyfoo.net/SDL_tutorials/lesson01/index.php . The tutorials in that website are also a good start to learning how to addle some aspects of game development. Hope it helps.
  2. Pedro Candeias

    c# tictactoe

    WOW! Really not wasting any time thinking there i see. If you know the size of your sprite or font you obviously can also calculate the place where you want to draw it. Say if the sprite was 300x300 and screen was 900x900, meaning u'd have 3x3 board of 300x300 each, if the player clicked on the top left one u'd just draw on 0x0 if top mid 300x0 etc. You obviously have to adapt it to the size of the font or sprite .
  3. Pedro Candeias

    Class array problem

    Wow nice thx so much. Even though the vector thing was working that thing kept bugging me. I couldn't figure out what was wrong but it. Thx for taking the time to take a look into the code.
  4. Pedro Candeias

    Class array problem

    Lol yes i jsut realized that. Thx man that fixed the problem i had with the vectors. Btw the reason i did tiles that way is because it also contains the collision box and that other stuff.
  5. Pedro Candeias

    Class array problem

    Ok so i've been also trying to do it with a vector class and i get the same proble. It works fine if i've only 1 item in the array but the moment i've more then that it start's bugging. The way i tryed to do it with the vectors was: std::vector<Tile*> lTiles; for(int i = 0; i < size; i++) { Tile tempTile(...); lTiles.push_back(&tempTile); } Same thing, no errors, no warnings related to it, just a laggy and unfunctional window. Btw the main.cpp is a bit weird coz i've been just trying it out in there.
  6. Pedro Candeias

    Class array problem

    Hey everyone, A few days ago I started my first attempt to do a "proper" game, and i decided to do a platformer. I had previously done some simple ones such as tic tac toe and duckhunt. I used SDL for the graphics. So i started by creating an object class, and then some class's who inherit from that one, so that can move, or so that they only use part of the surface image, etc. One of those class's is a Tile class, and that's where im having trouble. The class itself works fine, but when i try to create an array of that class, it just simply doesn't work. and the sdl window goes into a strange state. The i tried it in 3 different ways. First was with pointer like so: Tile *lTiles; lTiles = new Tile[size]; for(int i = 0; i < size; i++) { lTile = Tile(...); } Second method was same but without the pointers, just using a fix size array. Didn't work either. I get no error's and the warning's aren't related to it either. I also tryed it with new Tile(...). I'm probably just doing something terribly wrong and stupid but i hope u guys can help me find it. Also i know the tile class itself works coz when i try to run a single one without the array it works just fine. I hope im not posting this in the wrong place, i know there's an sdl dedicated area, but as this is more of a problem with the class itself i decided not to post there. I also added the code in case it's needed(keep in mind im still a newbie);
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!