Jump to content
  • Advertisement

JWindebank

Member
  • Content Count

    48
  • Joined

  • Last visited

Community Reputation

156 Neutral

About JWindebank

  • Rank
    Member
  1. JWindebank

    Pausing games using keyboard input

    Hi GuitarPlayer0912, Can you wrap your code in [code] [/code] tags thanks. :)
  2. JWindebank

    Problem with including header files

    Do you have the inclusion guards in all of your header files? Also are you declaring variables used throughout multiple files with the extern command? Could you post a copy of WinMain.cpp, Outpost.h and Outpost.cpp please?
  3. JWindebank

    Help drawing iso tiles

    This should help. :) http://www.19.5degs.com/element/832.php :)
  4. JWindebank

    SDL_Surface Size Limit

    I don't if such a limit exists, but I can happily load a 4.5mb 3900 * 400 BMP and have no issues. :) Cheers,
  5. JWindebank

    I am sure this has been brought up, but

    Here is a good starting point: http://www.gamedev.net/reference/start_here/
  6. JWindebank

    Who wants a tutorial to make a game

    I think there are enough tutorials out there on getting a newbie started with SDL, as well as most of the other things mentioned by people here. One thing I think is needed is a complete project from start to finish. Most tutorials are aimed at teaching you a certain aspect of the process but not the entire thing from design document to finshed project stage. Perhaps create just a basic 2D game, explaining the basics of initialising whatever 2D system (Allegro/SDL), handling game states, user input, scoring, sprites, collision.
  7. JWindebank

    Thriller techniques?

    How many partners you reckon you could lose before you got booted off the force though? :)
  8. VTOL = Vertical Take-Off and Landing I presume? I like the idea of keeping in touch by radio. Perhaps having allies radio you for help if they are outmatched, and you doing the same for them? Perhaps have an open channel for all players/NPC's ona certain 'team' where radio transmissions can inform the player of what the others are up to? Peraps certain areas in the game world can affect radio transmissions due to interference?
  9. JWindebank

    Thriller techniques?

    I think the difference is that in a novel, the write has only one outcome and is basing his/her story around that one outcome. Ina game, you need to make the choice actually matter to the story, or there is really no difference if my cop partner dies or not, is there? It needs to have real meaning so I actually have to be scared of taking the shot and missing. "Game Over" isn't enough of an incentive because I'll just load my last save game and try again...
  10. JWindebank

    Setting up a weapon firing system?

    Thanks everyone, I think I am getting the hang of this. Got this all worked out in my head but there are some slight implementation problems. Here is what I have currently: globals.h #ifndef _GLOBALS_H_INCLUDED #define _GLOBALS_H_INCLUDED #include "SDL/SDL.h" #include <vector> #include "graphics.h" #include "player.h" extern SDL_Surface *image; extern SDL_Surface *screen; extern SDL_Surface *back; extern SDL_Event event; extern bool gameloop; extern player player1; extern int SCREENFLAGS; extern float scroll; extern float sdlgt; extern float dt; extern int td; extern int td2; extern int keys[5]; // Left = 0, Right = 1, Up = 2, Down = 3, Space = 4 // extern std::vector<bullet> bulletlist; #define SCREENWIDTH 640 #define SCREENHEIGHT 480 #define BPP 32 #define TITLESTRING "Structure Test" #define MOVEMENT 5.0f enum directions { LEFT, RIGHT, UP, DOWN }; #endif player.h #ifndef _PLAYER_H_INCLUDED #define _PLAYER_H_INCLUDED #include "graphics.h" #include <vector> class player: public graphics::sprite { public: int getLives() {return m_lives;}; void setLives(int lives); void move(int direction); int collide(int direction); void fire(); private: int m_lives; }; class bullet: public graphics::sprite { public: bullet(); void update(); void setSpeed(float speed); float getSpeed() {return m_speed;}; private: float m_speed; }; class bulletcontainer { public: bool update(); std::vector<bullet> bulletlist; }; player.cpp #include "player.h" #include "globals.h" void player::setLives(int lives) { m_lives = lives; } void player::move(int direction) { switch (direction) { case LEFT: switch (collide(LEFT)) { case 0: addX(-MOVEMENT); break; case 1: break; case 2: //die() break; } break; case RIGHT: switch (collide(RIGHT)) { case 0: addX(MOVEMENT); break; case 1: break; case 2: //die() break; } break; case UP: switch (collide(UP)) { case 0: addY(-MOVEMENT); break; case 1: break; case 2: //die() break; } break; case DOWN: switch (collide(DOWN)) { case 0: addY(MOVEMENT); break; case 1: break; case 2: //die() break; } break; } } int player::collide(int direction) { switch (direction) { case LEFT: if(getX() <= 0) return 1; break; case RIGHT: if(getX() >= SCREENWIDTH - getW()) return 1; break; case UP: if(getY() <= 0) return 1; break; case DOWN: if(getY() >= SCREENHEIGHT - getH()) return 1; break; } return 0; } void player::fire() { bullet* newBullet = new bullet; newBullet->setPos((player1.getX() + (player1.getW() / 2)), player1.getY() - 10); bulletlist.push_back (newBullet); } bullet::bullet() { init("bullet.bmp", screen); m_speed = 3.0f; } void bullet::update() { addY(-m_speed); } void bullet::setSpeed(float speed) { m_speed = speed; } bool bulletcontainer::update() { for(int i = 0; i < bulletlist.size() ; i++) { bulletlist->update(); if(bulletlist->getY() < 0) { bulletlist.erase(i); } } } Now when I try and compile I am getting errors saying: error: no matching function for call to `std::vector<bullet, std::allocator<bullet> >::push_back(bullet*&)' Can anyone advise please? I am still not 100% sure on dereferencing and pointers but I am sure this is correct? Thanks,
  11. Hi everyone, First off we have already established I am quite the noob who loves getting in over his head, yay. :) Now, what I am trying to design is a system to 'shoot' from my ship sprite. (Have set up a very basic vertical scroller). I have a "sprite" class and have created a sub-class of it called "bullet". Now I am a little unsure as to how I create the array of bullets when it is impossible to know how many there will be on screen at any one time? Should I create an array with a "MAX_BULLETS" constant as the number, and just draw them if they are on screen or not? Similar to the way they are handled in Lesson 6 at Cone3D? The only other way I can think of is to use a Vector but I am still completely unsure on using a Vector of objects. It seems straight forward enough to add a bullet.update() function to move them all up the screen, check collision with enemies and destroy them once they pass the edge of the screen, but it is how to store them/create them that I am unsure about. If anyone can help I'd appreciate it... Thanks,
  12. JWindebank

    Clarification of Programming languages

    Here is a pretty good explanation of Microsoft's Dot Net technology. http://www.geekgirls.com/net_what_is_dot-net.htm C# is a new language deigned by Microsoft and built on the Dot Net framework. :) Not sure on Managed C++ or ANSI C though sorry. :)
  13. Cone3D SDL Tutorials - http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index Aaron Cox's Tutorials - http://www.aaroncox.net/tutorials/ Have a heap at home I'll add tonight. :)
  14. Xagon, is that site yours?
  15. JWindebank

    Splitting files?

    Thanks, that starts to make sense now. :)
  • 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!