Jump to content

  • Log In with Google      Sign In   
  • Create Account


Jeffige

Member Since 28 Jul 2012
Offline Last Active Aug 18 2012 10:00 PM

Topics I've Started

code for a 2d java game?

16 August 2012 - 12:44 PM

I have started to learn java so I could create 2D games for Android. Out of curiosity, does anyone know

where I could find a simple open source 2D game so I could look over the code? It may help ( even if I don't fully understand it, yet) to actually see code and how it was written out.

A side scrolling game would be perfect since that is what I am aiming for. But, beggars can't be choosy.

Thanks for any recommendations.

count++ & infinite loop

15 August 2012 - 09:49 PM

Working through java, a beginners guide 5th ed one of the examples:

[source lang="java"]public class forDemo {// Demonstrates the for looppublic static void main(String[] args) { // TODO Auto-generated method stub int count; for (count = 0; count < 5; count = count + 1); System.out.println( "This is count: " + count); System.out.println( "Done!"); }}[/source]

The author goes on to say that the example is not good programming and that you will not see programmers use that example, you would probably se this instead: count++.

But when I run it with the latter:

[source lang="java"]public class forDemo {// Demonstrates the for looppublic static void main(String[] args) { // TODO Auto-generated method stub int count; for (count = 0; count < 5; count = count++); System.out.println( "This is count: " + count); System.out.println( "Done!"); }}[/source]

it runs "this is count: 0 infinitely

thanks for any help.

Eclipse only shows java EE not java SE

12 August 2012 - 06:39 PM

When I open Eclipse in the upper right hand corner it only shows java EE, not java SE & it only gives me the option to start a java EE project not a java SE one. I had to re-download and install eclipse. Be for i had a problem and had to uninstall it would allow me to start a new java SE project.

Can any help me get coding again?

Thank you for any help.

Headfirst program doesn't run in cmd

11 August 2012 - 08:44 PM

I am following along with HeadFirst java. Got the path(s) correct, checked to make sure java was installed correctly with javac. I created a folder in: C:\Users\JEFFD\headfirst. Changed dir to C:\Users\JEFFD\headfirst. When I try and run javac MyVeryFirstApp.java, the dos window pauses for a half a second and returns with C:\Users\JEFFD\headfirst.


public class MyVeryFirstApp {

public static void main (String [] args) {
	 System.out.println( "I Rule!");
	 System.out.println("The World!");
	  }
}

thanks for any help.

Think java exercise answers

10 August 2012 - 07:20 PM

Does anyone know if there are any answers floating around to the exercises in Think Java: Think like a computer scientist by Allen Downey?

I'm stuck on exercise 2.11 - the 24 hour clock.

Thanks for any replies

PARTNERS