• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

andrern2000

Members
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

122 Neutral

About andrern2000

  • Rank
    Member
  1. Check this out. This may help you. lazyfoo .net /SDL_tutorials/ lesson05 /index.php (without spaces) Also, you need the image to be saved as PNG. If you saved it as JPEG, the color maybe compressed, resulting the color converted into another channel. So white maybe converted into alittle greyish, so the alpha color code doesn't match with it anymore.
  2. So, the check_collision() is overriden. Thanks.
  3. Basically you need to refresh the screen again, using update_screen() after SDL_freeSurface(). But, hey I get this from Lazyfoo tutorials too. So just go to it.
  4. If I use SDL_HWSURFACE, ..will the rendering process take place in VGA card's hardware cpu? I want to make a 2D game with fast rendering process as SW_SURFACE I guess will sometimes lagging when there are too many 2D objects on screen.... 2. I compare this with: I saw a look on Dark GDK's demonstrations. One of them is 2D demontration. Very fast images pasting with 1000 cycles...
  5. ..Bump.. I need this for my SDL game development.
  6. Xcuse me, Where can I download this SMPEG to play MPEG in SDL? I need this. I currently work on game SDL development.
  7. Quote:Original post by rip-off It is hard to say. The only thing I find strange is that the only way "title_screen" can return is if quit is true, which indicates that a SDL_QUIT event occurred. It is usual to exit the program in this case, I don't know whether SDL does something internally to the event queue once a QUIT signal has been generated. It might conceivably disassociate itself from the windows or something. Have you tried using an alternative quit method, such as maybe the escape button? A minor point: is "event" global? It should be pretty trivial to make it local in all cases. Simply pass it as a parameter to any functions that need access to it. I think I'll try that escape button exit method for the exit. Event is global. Yes, I think I'm going to change it to local to avoid internal collision with multithreading compilation. Thanks. @JParishy: it's the actual code. Sorry I didn't write the bool quit = false in the init. But everything went well. It enters the while loop and execute title_screen().
  8. I assume that when 'OTHER_VARIABLE_CHANGES', the tracking become online. This tracking tracks the EVENT_TRIGGERER variable. You have 3 following variables: 1. The tracking online variable. 2. The EVENT_TRIGGERER variable. 3. The OTHER_VARIABLE which experience a change, setting the tracking to online. IMHO, make tracking and this EVENT_TRIGGERER variable as GLOBAL. This way, when the OTHER_VARIABLE is triggered somewhere in a function, the variable 1 is set to online. The variable 1 is used to keep monitoring whether to start the tracking or not. If yes, the tracking is run, keeping an eye of the EVENT_TRIGGERER variable. You can use the variable EVENT_TRIGGERER anywhere in the program to trigger an event and the Track() will report if it works. But the tracking won't work unless it's set online if OTHER_VARIABLE changes. So: BOOL TRACKING_ONLINE BOOL EVENT_TRIGGERER int function() { if(OTHER_VARIABLE_CHANGES) TRACKING_ONLINE = true; } int main() { if(TRACKING_ONLINE) track(); } int track() { if(EVENT_TRIGGERER) cout<<"The variable EVENT_TRIGGERER has triggered an event!"; else cout<<"The variable EVENT_TRIGGERER is inactive"; } Is it what you're looking for?
  9. Hi, nobody answers my thread in For Beginner section, so I post it here ----------------- Has anyone experienced SDL_PollEvent(&event) in a function quits its while loop when it's executed? while(SDL_PollEvent(&event)) ...in this code: int title_screen() { bool quit = false; Title theTitle; while( quit == false ) { //While there's events to handle while( SDL_PollEvent( &event ) ) { theTitle.handle_input(); if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } //Apply surfaces apply_surface ( 0, 0, title, screen ); //Update the screen if( SDL_Flip( screen ) == -1 ) { return 1; } } return 0; } I'm using Multithreaded DLL code generation. The first time title_screen()executed it's normal. That function title_screen() is called within main(). But second time it's executed (the flow is after title_screen() -> main_menu() -> title_screen(), so this function is called again) the SDL_PollEvent() returns false, avoiding the handle_input() function. The main_menu() uses SDL_PollEvent() too and experiencing same problem: First time called it's normal, second call PollEvent() quits irresponsibly. What possibly happening? --------- Btw, this is my main() function: main(...) { while (quit=false) { if mode=1 { title_screen(); } else { mainmenu(); } //While there's events to handle while( SDL_PollEvent( &event ) ) <-- Could it be collides with &event here? { if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } }
  10. class Character { int velocity; int distance; bool fire; void keydown(); void move(); } Character::keydown() { switch(input) { case up: velocity +=... case down: velocity -=... case left: velocity +=... case right: velocity -=... case FIRE: fire = true; } } Character::move() { if(fire = true) ... else { distance += velocity; If (outbound of screen) { velocity=0 } } } Does this help you? IMHO this is the more standardized way using OOP
  11. That is a clean concept of a game engine. But what game are you planning to make? A game engine like that link is capable of doing worthy project like 3D game. If you try to create simple 2D game, you can make the engine in just a function instead of creating one whole engine like that. Example: create_level(), create_star(), load_files(). Does this help u? [Edited by - andrern2000 on March 29, 2009 6:13:55 AM]
  12. Nobody want to help? I need the solution immediately. Wait, let me rewind a bit detail: There are no errors, just the missing condition somewhere in... while( SDL_PollEvent(&event) ) ...which makes it returns false when executed inside a function that's called twice within the main(), so that it won't enter the body. My question is: What causes it to return false? ==== Btw, my main() function: main(...) { while (quit=false) { if mode=1 { title_screen(); } else { mainmenu(); } //While there's events to handle while( SDL_PollEvent( &event ) ) <-- Could it be collides with &event here? { if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } }
  13. Sorry! No intend to spam. The double post is unintentional. I clicked the Submit button twice.
  14. Has anyone experienced SDL_PollEvent(&event) in a function quits its while loop at the beginning it's executed? while(SDL_PollEvent(&event)) ...in this code: int title_screen() { bool quit = false; Title theTitle; while( quit == false ) { //While there's events to handle while( SDL_PollEvent( &event ) ) { theTitle.handle_input(); if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } //Apply surfaces apply_surface ( 0, 0, title, screen ); //Update the screen if( SDL_Flip( screen ) == -1 ) { return 1; } } return 0; } I'm using Multithreaded DLL code generation. The first time title_screen()executed it's normal. That function title_screen() is called within main(). But second time it's executed (the flow is after title_screen() -> main_menu() -> title_screen(), so this function is called again) the SDL_PollEvent() returns false, avoiding the handle_input() function. The main_menu() uses SDL_PollEvent() too and experiencing same problem: First time called it's normal, second call PollEvent() quits irresponsibly. What possibly happening? [Edited by - andrern2000 on March 28, 2009 4:56:12 AM]
  15. Perhaps you need a separate function to number the objects you want to represent its ID.