What language should i use to make little games? like a language that is easy to make games for.
What language should i use to make little games? like a language that is easy to make games for.
Depends on what you mean by "little games".
Text-based games? Almost any language will do, although a simple scripting language or something that offers a nice text manipulating library would probably be nice.
Perhaps 2D games? This is personal preference depending on a few things. If you're not very good at memory management and never remember to free() what you malloc() or delete/delete [] what you new, a languague like Java might be easier to work with if you're interested in focusing on concepts as opposed to language details. Java, though, suffers from a lot of setbacks, so it's trade off.
If you can take care to clean up memory, and pointers and such are not a hard concept for you to understand, then both C and C++ are well able to do what you need, although I would recommend using some library like SDL or Allegro if you go that route.
Why would you ask this on a board devoted to the C/C++ language?
Perhaps you already know the answer.
Experiment around with different languages until you find one you like. That's what I did and why I picked C++. I just couldn't get used to any other language.Originally Posted by roobert
If you have some programming experience but not much, but would like to create a game simply and quickly. Then Java is a good place to start, as it will allow you to get into programming and hide some of the complexity like memory management. Although you can play about with the garbage collector or force it, but that’s not important to you. I re-created the Mega-Drive computer game Streets of Rage 2 in Java, work great. Did it for my final year project at UNI. Plus java is fun.
Most common:
[Language] C++/Delphi/Pascal/Python [Library/Technique] Console/DirectX/OpenGL/SDL
Plus mostly for web:
Java
Flash
"The Internet treats censorship as damage and routes around it." - John Gilmore
You can't force the GC, at best you can hint it (and doing so is usually counterproductive in that it forces the GC to (if it runs on the hint at all) perform a full GC cycle rather than an incremental GC cycle, consuming unnecessary CPU cycles, and can be forcibly ignored through JVM configuration).
Just about the only time you may want to do that is when you have an application that you know will require a lot of memory for a longrunning operation. Just before consuming that memory you might want to try and get the GC to run so you have as much free RAM as possible, hopefully reducing GC overhead during that expensive operation.
It is, and productive as well.
Indeed. I have software I'm developing in Java that I wanted to take advantage of some.... -- perhaps I could call them "bizarre features" since they might be better implemented in a different way -- that require garbage collection. I find it annoying that I can't manage memory myself in Java, and I can only ask for the cleanup to possibly, maybe, perhaps, be attempted.
If Java had a way to manually delete an object, that would be nice.
I have to say, though, everytime I've asked the system to perform a garbage collection, it's appeared to work, and the necessary objects/classes appeared to be unloaded. I know this should not be relied upon, but I figure if it works... hey it works. If it doesn't, then it doesn't.
Example of kind of forcing garbage collection but using runtime: But i agree, using something like System.gc() is just a hint, and it does not guarantee immediate action, but actually it could slow your app down.
Code:/* * This Java program shows you how to force garbage collection * Author: Megh Thakkar */ public class CollectGarbage { int ASIZE = 1000000; void useMemory() { int[] intA = new int[ASIZE]; for (int i=0; i<ASIZE; i++) { intA[i] = i*2; } } public static void main (String[] args) { CollectGarbage gct = new CollectGarbage(); // Get a Runtime object Runtime r = Runtime.getRuntime(); // Collect garbage at the start of the program r.gc(); // Let's see how much memory we have at the start long availMem = r.freeMemory(); System.out.println("At program start we have : " + availMem + " bytes"); // Let's use some memory gct.useMemory(); // Let's see how much memory is left long availMem1 = r.freeMemory(); System.out.println("After running the program, we have : " + availMem1 + " bytes"); // Collect garbage r.gc(); //Let's see what we have now long availMem2 = r.freeMemory(); System.out.println("After collecting garbage we have : " + availMem2 + " bytes"); long freedMem = availMem2 - availMem1; System.out.println("Garbage collection freed : " + freedMem + " bytes"); } }
I've been working professionally in Java for almost a decade and never missed the ability to explicitly handle memory...
The reason why calling Runtime.gc() slows down your system (usually momentarilly) is the heavy operation it triggers (if it triggers anything of course).
When letting the JVM do its own thing it runs at a constant trickle in the background, consuming only spare CPU cycles when it can and not pushing itself into the limelight unless it has to.
You can do the same under C++. You just either have to find a garbage collector library or code your own.Originally Posted by mmarab
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
http://www.devarticles.com/c/a/Cplus...r-C-plus-plus/
but why go to the trouble when Java has one built in as standard that just works?
use macromedia flash, it has an OOP oriented IDE and such, blabla. :-) tons of tutorials, etc etc... most games around the net are flash or shockwave so you see it's popular.
ActionScript is pretty much JavaScript just OOP and added language features.
It's far simpler than doing such a project with the same potential in c++ without the extra work. Flash can hand all sorts of audio files for you, and all that mess. You really just focus on game logic in Flash, you also should be patient with flash, it has a learning curve as well.
flash also has 3d capabilities, so you can display models and adjust the camera, etc....
Java won't look or work as nice as flash apps right away*, both java and c++ applications will require an obscene amount of "messaging" just to -render- the graphics as flash already does.
in flash you just worry about putting all the resources together, and as i said, game logic.
Last edited by simpleid; 08-15-2007 at 07:42 AM.
I agree. I've seen many simple flash games.use macromedia flash,
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
if you look at modern games like forza motorsports 2 on the 360. what language is that made in, does anyone have any ideas