Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Game Development and the fly likes Game dev relevant coding skills Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "Game dev relevant coding skills" Watch "Game dev relevant coding skills" New topic
Author

Game dev relevant coding skills

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Hi all,

For a while I've been considering buying a book entitled 'Java 6 Game Development' (or something like that)but have continually put it off.(What the heck my coding skills will be better in a few months anyway)....then I got onto thinking about how these books usually teach you...I will probably just end up memorizing a bunch of classes for graphics/timers etc... but the most valuable things I learn will be gaming design patterns/mechanics etc...

So I was wondering if I would maybe get off to a stronger start by maybe studying threads/IO in depth before I attempt to get into a game dev book...
What are your thoughts on this??


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Duran, I think it's just a question of preference. How do you like to learn? Myself, I like project driven learning, I dive into a project, and if I find I am weak in a certain required area, the project goes on hold and I go back and do the basic learning.

So, If you delve into a book on gamedev, and then you find you need more skills on threading, I see nothing wrong with putting the gamedev book down for a while, learning the material on threads and IO, then going back to gamedev.

It kind of depends on your goals. If you want to become a well rounded programmer as quickly as possible, then maybe this approach I describe is not the best, maybe your suggestion is best.

no hard and fast rules on this topic, IMO.

by the way, if you are really into gaming, check out gamedev.net if you haven't already.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Yes ,maybe you're approach is sensible..I think I will do that.
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Duran Harris wrote:Yes ,maybe you're approach is sensible..I think I will do that.


Cool. I'm certainly not an expert in java, for me a project is just a vehicle to make learning interesting, So I am not afraid to code something knowing it is probably not the best, and I might end up discarding it, but it is the best based on my knowledge at the time. Then as I learn more I think of ways to improve what I have, so my projects often go through a few iterations. That's the way I like to do it, if it works for you too, then great.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Well I will take your advice considering that you can make a java chess program...I tried to make a swing minesweeper but I couldnt figure out how to make it run at a reasonable speed.
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Do you mean the Minesweeper ran too fast? There are are certainly ways to slow things down, maybe by making appropriate use of thread methods, or Swing Timer, etc.

As for the chess program, well it's not rocket science, it took a long time to get here, and there's a long way to go. And I certainly had to put my theories on project learning to the test. It's a hobby in and of itself that will keep me going for a long time to come.

good luck and see you around. This Game Development forum needs more activity.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

No it was too slow..it was checking almost every tile on the board when i clicked..But it's fixed now.Was interested in making a calculator but the whole postfix notation seems a little difficult for me to follow....
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
If you want web references, here are two introductory articles on animation threads and Applets that I found very helpful. I think Javaworld does a great job of explaining basic concepts, these articles got me over the hump with regards to threads and animation

Just keep in mind that the material is somewhat dated, and makes reference to some deprecated methods such as stop(), so they should be supplanted with current info perhaps from the Sun Java Tutorial and API docs. Also, the articles do not deal with Swing. Nonetheless they are a very good introduction and they make the more up to date, and also more complex, material on threads in the Sun Java Tutorial easier to understand, for me anyways.


http://www.javaworld.com/javaworld/jw-04-1996/jw-04-threads.html


http://www.javaworld.com/javaworld/jw-03-1996/jw-03-animation.html?page=1
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Thanks!
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

about the mindsweeper......


1. Keep a counter variable that increments every time a cell is opened,
so when counter = total cells, game complete !!
This is more optimal (and simple) than checking each and every cell for stuff

2. When a cell is clicked, make recursive calls to click event of the respective cells to be opened.

Actually thre are tons of optimisations that you can do to make your game run faster.



About the calculator

There is a design pattern ("Interpreter" if i am not wrong) it dictates how a grammer can be parsed
using stacks, etc.
Take a look at it...

My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
Andy Ranangnai
Greenhorn

Joined: Aug 11, 2009
Posts: 16
Check out the O'Reily Head First series, they did a book on Java SE 5 or 6 and they have a really spastic and fun way of explaining things. They have lots of source examples too, so it's really entertaining and interesting.


C:\DOS

C:\DOS.RUN

RUN.DOS.RUN
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

Andy Ranangnai wrote:Check out the O'Reily Head First series, they did a book on Java SE 5 or 6 and they have a really spastic and fun way of explaining things. They have lots of source examples too, so it's really entertaining and interesting.


granted thats a good book on Java SE.

but i fail to see how its relevant in the current discussion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Game dev relevant coding skills