Jump to content


Member Since 06 May 2012
Offline Last Active Aug 24 2014 08:04 PM

#5093290 coin flip problem

Posted by CaptainKraft on 11 September 2013 - 09:31 AM

My experience with C++ is pretty limited but I think I might be able to help here.


It looks like you are calling the randRange function before entering the if statement, and you are assuming that the result is stored in a variable that is called randRange. What you need to do is either store the return value of the function call into a variable, or just call the function within the if statement. I prefer the latter, and here's a small example:

if (randRange(1, 10) >= 5) {
    // do stuff here

That should solve your current problem.

#4960943 Inventory System

Posted by CaptainKraft on 19 July 2012 - 08:19 AM

I'm going to avoid answering the question to a specific programming language and just sort of explain my thinking based solely on OOP.

First, you could start with the "Item" class that you can extend in each other class for their respective item types. The fields and functions in "Item" would just be what is common between every item. (ie. name, size, etc.)

Once you start making new classes like "One Handers" or "Consumables" you can get more specific. You could create the functions that only those item types can use. (ie. equip, getDamage, etc.)

This is the very beginning of what could end up being your entire game's item system. I don't like providing code or getting into super specific details because it's more fun to figure it out on your own.

One more thing that I will say, is that you can break up your "Inventory" into multiple collections. For example, you could keep an array of consumables, an array of weapons, and an array of armor. Then when you display them to the player you could separate them logically. The problem that might come up is keeping track of how much stuff is in your inventory. This could easily be solved by using a counter for each item you pick up, or adding weight to your items.

Anyway, I hope I helped at least get the creative juices flowing. Also, I'd love to hear what your ideas are at this point. You may not have an answer yet, but you must have the beginnings of what your inventory will look like.

Happy coding

#4960229 HAXE - Multiplatform Programming

Posted by CaptainKraft on 17 July 2012 - 05:10 PM

I just posted here to see game developers' experience with it. Figured I'd find that here easier than anywhere else.

#4960156 HAXE - Multiplatform Programming

Posted by CaptainKraft on 17 July 2012 - 01:54 PM

I recently heard about an update for HAXE which allows it to compile to Java code. You can check it out at http://haxe.org/

Also, I was curious if anyone here has any experience with the language. It's been around for a while now but this is the first time I'm hearing about it.

If anyone has used it, how viable is it for game programming, especially for the web?

#4955978 Help me change my life and career.

Posted by CaptainKraft on 05 July 2012 - 07:53 AM

The Croaker,

I'm in no way a professional game developer yet, I'm just working on that part myself, so keep that in mind. I just figured another point of view couldn't hurt. Also, my point of view is probably pretty different than most of the people on this forum.

First of all, if you want to make games as a career, it will probably take you many years before you consider yourself "successful." The learning part will take quite a while as well as figuring out how to make money.

I would HIGHLY recommend you read the book Crush It written by Gary Vaynerchuk before you do anything else. It may seem unrelated right now, but once you read the book I think you'll have a different outlook on how you can make game development a career. You might also want to consider what the goal is for your career. Do you want to make games as an indie company and distribute them on your own, do you want to work in an office for a commercial gaming company and collect a paycheck, or would you like to do something completely different.

As far as what language to learn, I completely disagree with just about everyone who posted here. I think it is almost negligible. I spent wayyyyy too much time trying to answer this question myself. What I should have done was just pick one and program my ass off. Now I feel like I'm behind because I spent so much time trying other languages out and searching for advice via forums and reddit. Just pick one that you enjoy or know a bit about, and learn something everyday.

What I think my biggest problem is when trying to learn to make games is that I'm focusing too much on the long term future. Right now, it really doesn't matter. What matters is making the game I'm working on or maybe just learning one concept right here and right now.

Anyway, my final piece of advice and a sort of TL:DR section is this:

Don't worry about what will happen in 5 years, just focus on getting a little bit better everytime you program. Start making a game TODAY no matter how simple it is. Don't quit programming if it is something you enjoy. No matter what anyone else tells you.

I wish you the best. Game development is fun as hell!

#4953524 Game Programmer's Rite of Passage

Posted by CaptainKraft on 27 June 2012 - 06:32 PM

My (newbie) advice would be to design a game you would like to make, something that you enjoy playing/making. Strip it down to the basic elements, see if it is a realistic project. Then try doing it!

I'd have to agree with this without a doubt!

Most people struggle to grasp concepts or retain information because they are doing something that doesn't interest them or doesn't keep their attention.

I'm a complete noob and have only made one game, so take my advice with a grain of salt. I also wrote an article about going ambitious from the start, if you'd like to check it out.

No matter what you do, I wish you luck and can't wait to see some finished stuff that you make.

#4952687 programming student but game development newbie

Posted by CaptainKraft on 25 June 2012 - 10:09 AM

I'm in a similar position. Right now I'm going to school for Computer Science and I love to program, but I've just started learning game development.

If you learn well visually, check out these videos on youtube. I don't think the owner of the channel has uploaded a video in a while, but I really like his playlists for gamedev.

Those should get you started making your first game if you want to start with simple 2d stuff. I've also wrote an article on my blog about my first game and what I learned from making it. You can click the link in my sig if you care to check it out.

Good luck

#4952365 Top Down Rpg

Posted by CaptainKraft on 24 June 2012 - 10:47 AM

@glhf I'm not sure about the person actually making the engine, but I try to avoid most engines so that I can learn more about the gamedev process as I go along. You get a MUCH better understanding of what is happening when you do all the dirty work yourself.

Making your own engine is obviously slower, but when you are trying to learn, it's not really about quantity, it's more about quality.

You also get more control when making your own engine so you aren't stuck with code that doesn't really fit with what you are doing.