Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Moogle

Okaaay, Can anyone tell me...

This topic is 6044 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

Can anyone tell me what I should do now I mean I know C++ and I know the SDL i need to know to load BMPs and put them on the screen but what about the acctaull GAME. It bugs me hard. I understand the game loop but what do you do in there !!! None of my books explains that !!! I want to make an actaull game. Argh!

Share this post


Link to post
Share on other sites
Advertisement
He''s right though, none of these so called games programming books actually show you how to make an actual game.

Quite often they just show how to write an engine and how to do a few bits of AI and physics here and there but they never show how to put it all together which personally I think should be a big part any general games programming book.

- Kaijin

Share this post


Link to post
Share on other sites
Take a course in C++ data structures if you havent already and another in advanced OOP, or learn it yourself, its not that hard. Then buy The Zen of Direct3D Programming.

-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.

Share this post


Link to post
Share on other sites
That still won''t help him to write game code. I think he''s looking more for information about how to write game logic and putting it all together.

- Kaijin

Share this post


Link to post
Share on other sites
Programming isn''t about taking bits a pieces from this and that code putting it together and working computer magic. Eventually you are going to have to program some lines of code for yourself. Starting on something is actually one of the hardest parts of programming. Knowing where to start can be daunting when the whole project is ahead of you, but you can never get past that if you don''t make the leap and start it for yourself. Personally I usually start with a simple rotating cube or triangle display tutorial and start adding things. After you''ve added quite a few pieces you''ll already have a foundation you can work on. Thats when I go back and create my data structures and rewrite core management code such as texture loading and handling. But you have to start in order to get anywhere.

Share this post


Link to post
Share on other sites
Then go buy a book on how to make games. There are books that do this, they contain nearly no code or programming stuff but just rant on about how to design and plug bits together.

If the worst comes to the worst you could just figure it out yourself. It's not like you going to try and create Quake 4 (are you?) Aim small at breakout or somthing similar and put your design down on paper. Later think what you need to do every turn, check for collisions, move all the objects, animate stuff etc. Once you've got it all down on paper in front of you thing fit together much easier.

A good tip would be to keep you main loop simple, just call 10 functions or something similar and place all the complex code in there, if you do that it's far easier to track down problems.

I don't mean to sound harsh but if you don't think you can't manage to figure it out yourself then you might want to try learning a bit more programming first.


zipless

Edited by - zipless on January 3, 2002 11:07:19 AM

Share this post


Link to post
Share on other sites
quote:
Original post by Xanthen
. Eventually you are going to have to program some lines of code for yourself. Starting on something is actually one of the hardest parts of programming. Knowing where to start can be daunting when the whole project is ahead of you, but you can never get past that if you don''t make the leap and start it for yourself.



That''s very true but there''s nothing wrong with giving people a helping hand. While it''s good to learn things by yourself and from your own mistakes it''s also good (and often faster) to learn from others examples (and mistakes ). That doesn''t just apply to programming.

Games programming is quite different from other kinds of programming so some people find it difficult to adjust to the way of thinking.


quote:
Original post by untalkative_monkey
one...two...three...FOUR words, Game Architecture and Design.
(its a book)

...go on and live with no regrets, you only have one life...



Glad you learnt how to count Yeah, I have that book. It''s a very good book but my point is if a book has "Game Programming" in the title it should teach you how to put an actual game together not just an engine. Just my opinion.

And just for clarification, I''m not compaining that I don''t know how where to start. I''m just saying that these books that teach you how to make a game should live up to their claims.

- Kaijin

Share this post


Link to post
Share on other sites
Hello Moogle,

A game loop usually consists of code to update and flip the screen from back to front in a double-buffer system, check the event status of the keyboard. Look up events in the SDL documentation to create an event loop using SDL_Event. Also for a crude way to slow down your game loop, look up SDL_Delay, which can be put at the end of your game loop. Here's a pseudo example

SDL_Event event;

while(!quit)
{

clear out sprite's last known coordinates;
show your sprites at new locations (SDL_BlitSurface);

switch(event)
{
case QUIT_DETECTED:
quit = true;
break;

switch(check the keyboard for keypresses)
case upkey:
decrease the sprites y-coordinate;
break;
case downkey:
increase the sprite's y-coordinate;
break;
}

SDL_Flip(screen);
SDL_Delay(some length of time);
}

Again, look up SDL_Delay, SDL_Flip, SDL_Event and keyboard input. A game loop is just a way of updating all of data in your game world and also checking for user input so that you know how to update aforementioned data.

All of this is available in the SDL documentation. That will get you started, but you need collision detection, physics engine, AI, etc.

To move a guy around the screen, simply check for keypresses up and down and key releases thereof. Turn keyboard repeat on (look through the list of functions) and program your loop so when you press a key it will update some variable corresponding to the sprite's location. Then erase the bitmap you drew on the screen and draw a new one at that location... It's a good way to start but probably not the best way to do everything.

Good luck!

Edited by - Anesthesia on January 3, 2002 4:53:32 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!