• 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.

armitroner

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

132 Neutral

About armitroner

  • Rank
    Newbie

Personal Information

  • Location
    In my house, durr.
  1. IMHO, beginning with getting a firm grasp of the basics of C will help you in the long run when delving into C++. As for where to begin learning C++, I think that it's best to go for just a general knowledge of C++, then going to a specific area of programming style, such as game programming. If you want a mixture of good knowledge of C++ as well as the basics for game programming, I'd recommend the book '[i]C++ Programming for the Absolute Beginner' [/i]by Mark Lee. It teaches you how C++ works just like a normal book would, but using game analogies and examples to teach you, so it's like hitting two birds with one stone. However, it still stands that you [i]should [/i]learn some C before C++. I started off messing around with C, in which I developed my first text-based game (which I got rid of last year). After that, I read the aforementioned book, and used the net to learn C++, and I'm in the process of making another text-based (soon to be 2D grapical! ) game. But still, you should just do what suits you best. All we can offer are pointers and advice.
  2. [quote name='rip-off' timestamp='1352715500' post='5000174'] [quote] I only used goto in one small section, since I don't have much need for it elsewhere. [/quote] You are essentially abusing goto to create a loop. Instead, use an explicit loop: [code] ... [/code] Note that this automatically handles the case where the user types an invalid option by looping around, though it is generally nicer to print a specific message in this case. Another potential improvement is to dynamically remove invalid options from the menu. Something like this: [code] ... [/code] I'm not sure if you are familiar with std::vector or function pointers. Feel free to ask a question if you don't understand what this code is doing. [/quote] From what I can see in the second example, it's working sort of like an array. It appears to be creating a single, erm, (for lack of a better term) method that carries the other functions in it, kinda like how a class works? Then it grabs how many functions are underneath CombatChoice and displays them, dependent upon wether or not they meet the conditions given when using the push_back function. (not sure what push_back is) Finally, when choosing the option, the reason you created that variable when creating the menu was to add an extra bumper in case the player chose the number of an option that wasn't even there. I'll do a bit of reading on std::vector, since this is the first time I've come across the term. This was actually my first serious C++ project, so I had to hunt down tons of stuff on the net. [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img] Anyhow, thanks for the advice, and I'll be working on improving my code once my compiler gets fixed... [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img]
  3. [quote name='TheChubu' timestamp='1352681646' post='5000061'] You could implement your battlemenu separately and make a call to it when you need it instead of using goto. The thing about goto is that you basically get rid of every pre/post condition that a block of code should have. When you have an if else block that, besides having the two normal possible outcomes (if branch or else branch), jumps to another place with a goto in the middle, then nothing is safe anymore. You stomp over every "safety" that basic control structures should give to you when using goto to reach some place in the code. Its like having a carefully designed brake system in a car, only to go and smash it against a wall because you think you can stop the car faster by doing so. [/quote] [quote name='superman3275' timestamp='1352681863' post='5000063'] Goto can also make spaghetti code. A lot of times what ends up happening is that your code is jumping from place to place, making it extremely hard for other people to understand what you're doing. It also makes it hard for you. (Example: Code an awesome enemy system. A month later you need to extend it. Go to look at it and it keeps on jumping to a bunch of places, and you don't understand it, so you scrap all your code.). Now, GoTo isn't always evil. There's an application for everything. However generally using Goto is frowned upon, and the problem you're solving with it can be solved by using object oriented programming. [/quote] I see. So basically, goto is really only a last-ditch alternative for when you don't need to go back and extend it all that much. The better thing to do would be to create a separate class specifically for the battle menu? Crap, another class I have to make... Anyhow, thanks! I'll see how I can change it to a class, though I'm still not entirely sure how to split all the options into a class, so maybe I could get a couple pointers here?
  4. Oh, yeah, sorry! I only used goto in one small section, since I don't have much need for it elsewhere. [source lang="cpp"]void Combat::combatChoice(Character& C) { if (C.health < 0 || C.health == 0) { cout << "----------------- You died... ------------------" << endl; cout << "Oh dear, it seems you have died... Game Over." << endl; } else { battlemenu: cout << "----------------- Battle Options ------------------" << endl; C.Display(); cout << "What do you want to do? \n" << "Type the number of the action and press enter. \n" << "[1] Melee Attack \n" << "[2] Gun Attack \n" << "[3] Health Potion" << endl; short choice; cin >> choice; switch (choice) { case 1: cout << "\n----------------- Battle Results ------------------" << endl; C.meleeAttack(M); break; case 2: cout << "\n----------------- Battle Results ------------------" << endl; if(C.ammo == 0) { cout << "You're out of ammo! \n" << endl; goto battlemenu; } else { C.gunAttack(M); } break; case 3: cout << "\n----------------- Battle Results ------------------" << endl; if(C.potions == 0) { cout << "You're out of potions! \n" << endl; goto battlemenu; } else { C.useHP(C); } break; } } }[/source]
  5. I've made a simple little text-based game that implements an extremely primitive menu. For it, I have designed a small option menu for attacks. Before, it used to automatically move on to the opponent's attack if you happened to use the gun attack if you were out of ammo, so I fixed that by adding a goto function that reverts back to the option menu before the enemy initiates it's attack. I've read in some places that goto is unreliable, and indeed, shouldn't be used in most cases. I was just curious as to specifically why this is, and what alternative could I use?
  6. Despite my hunting the internets, my bounty hunter visor fails to locate any C++ tutorials for simple roguelikes. Can anyone point me to a good roguelike tutorial for C++? Thanks!
  7. Thanks! I'll be researching ncurses and fixing my code. Rep for you! Edit: Quick thing more... how do I fix my code for ncurses..?
  8. I see. What would be the latest C/C++ equivalent?
  9. I was starting on programming my first game ever, a roguelike. I typed out the bare essentials, and I even have the help of a small tutorial, but when I tried to compile this, it gave errors such as: [CODE] Symbol 'console' could not be resolved. Symbol 'true' could not be resolved. Method 'Clear' could not be resolved. Method 'Position' could not be resolved. Program 'make' is not found in PATH. [/CODE] I'm using the latest Eclipse for Mac OS X. Here's the program's code: [CODE] #include <conio.h> #include "Console.h" int main( void ) { console.Clear(); int nPlayerX=40, nPlayerY=12; while( true ) { //Output phase console.Position( nPlayerX, nPlayerY ); console << '@'; //Input phase char nKey = getch(); //Processing phase switch( nKey ) { //Move down case 's': nPlayerY++; break; //Move left case 'a': nPlayerX--; break; //Move right case 'd': nPlayerX++; break; //Move up case "w": nPlayerY--; break; //Quit case 'q': return 0; break; } } return 0; } [/CODE]