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

Posts I've Made

In Topic: code for a 2d java game?

17 August 2012 - 12:58 PM

If you're just starting Java then I would pick up a book to learn the basics of the language.


Wow! Thanks David. That is more & concise info that I have read in one spot. Actually, after searching a couple of weeks
for a good starting java book, I eneded up with java, A beginners guide 5th edition. I have read, although I do not need to know complete java, I do need to know the core. After that, I can start on Android while still learning java.

As for frameworks & libraries, No Idea! I have not gotten to that intersection, yet. I do know that I only want to create simple 2D games like Tetris, Space invaders, Tumbl on Android, and some simple kid games like where they snap the puzzle pieces into place and an ABC learning game.

On one of the posts here at gamedev.net I read someone mentioned this (sorry I have forgotten who exactly)

A complete understanding of the basics would be desirable.
Specifically the following topics:
•Declarations and Access Control
•ObjectOrientation
•Assignments
•Operators
•Flow Control, Exceptions, and Assertions
•Strings, I/O, Formatting, and Parsing
•Generics and Collections
•InnerClasses
•Threads

I know even a simple 2D game is a lot of work for a beginner. So, I'm taking it one line of code at a time.

Thanks for the replies.

In Topic: code for a 2d java game?

16 August 2012 - 07:44 PM

Thanks guys.

David M, as of now, I just started to learn java (any programming for that matter) a few weeks ago. Self teaching/ learning with java, A beginners guide 5th ed. So, framework or engine? Couldn't tell ya.

I was just thinking if I looked over the code from an actual 2D java game, it may help me to understand as I learn along. As for Android, that is my ultimate goal.

Again, thanks for the help.

In Topic: count++ & infinite loop

15 August 2012 - 10:52 PM

Another thing, if you put a semicolon after a loop statement it turns the loop into a empty loop (since the semicolon by itself is simply the null statement). To fix this problem you need to get rid of the semicolon after the for statement (but only after the for statement).


Yeah I just got that as you posted. Thanks Ruler

In Topic: count++ & infinite loop

15 August 2012 - 10:51 PM

Um... nevermind. I guess this is why you should check the code first!

for (count = 0; count < 5; count = count + 1); <<<<<semicolon - that's why it didn't work. sorry guys.

It's just count++, not count=count++. It's not better programming per se, just shorter. I don't use it the way you have, but if I recall correctly the return value of count++ is count, whereas the return value of ++count is count+1.

It makes more sense as below:
[source lang="java"]int count = 0;count++; // count is 1 after this++count; // count is 2 after thisint a = count++; // a is 2, count is 3 after thisint b = ++count; // b is 4, count is 4 after this[/source]


So would that be more relevant, er... a better writing of that code? I just don't want to get into the habit of writing code people may frown upon.

In Topic: count++ & infinite loop

15 August 2012 - 10:40 PM

When I write:
[source lang="java"]for (count = 0; count < 5; count++);[/source]
it gives me: This is count: 5

From what the author says it's suppose to display the exact loop as the first example:

[source lang="java"] for (count = 0; count < 5; count = count +1);[/source]

thanks again.

PARTNERS