Results 1 to 5 of 5
- 01-22-2012, 09:35 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 17
- Rep Power
- 0
i'm totally new in java..help me to [build snake game using java]
hello guys..i'm new in java..
i got final project to do and my lecturer asked me to build a snake game using java..
my question is:
Can somebody help me in creating a menu for that snake game which contain selection like "play","credits" and "exit"..
and can somebody teach me how to link from one class to the other class such as "snake.java" class to connect with "board.java" class??
please guys,i'll appreciate u guys help..
- 01-22-2012, 01:28 PM #2
Re: i'm totally new in java..help me to [build snake game using java]
Post your code and the problems you are having with it.
This can be done by passing a reference in a constructor.how to link from one class to the other class
In one class:
OtherClass ocRef = new OtherClass(this); // pass a reference to this class to the constructor of other class
Now OtherClass has a reference to this class and can call its methods.
- 01-24-2012, 07:09 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 17
- Rep Power
- 0
Re: i'm totally new in java..help me to [build snake game using java]
thanks a lot norm..how long have you been in this java world??i just starting to learn JAVA 8 months ago and now my lecturer asked me to build a java game..
- 01-24-2012, 01:34 PM #4
Re: i'm totally new in java..help me to [build snake game using java]
Building a game is a good way to get started.
- 01-24-2012, 03:51 PM #5
Re: i'm totally new in java..help me to [build snake game using java]
Games were the first things that really got me interested in programming. My first was a text based adventure game! Good times :D Snake is a great first game, it can be implemented simply using girds/tiles or shapes/images. The input is simple, and the logic isn't complicated. Map out the features you would like to use first, and consider how they would work during gameplay. Then start small with your implementation - get a window on the screen, get an image to appear, get a buttonListener to work for user input. Once all of those things work, then you can use what you learned to start building the actual game. Things like pulldown menus should be one of your last considerations, as they are simple and not vital to basic gameplay.
When you do get that far, here is the official JMenu tutorial: How to Use Menus (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
Similar Threads
-
Snake Game in Java
By Shyamz1 in forum New To JavaReplies: 4Last Post: 02-10-2011, 02:49 PM -
Snake game in java
By freaky in forum New To JavaReplies: 5Last Post: 04-20-2010, 06:34 PM -
Java Applet Help - Making "Snake" Game
By Alphimeda in forum Java AppletsReplies: 15Last Post: 04-04-2010, 05:39 PM -
Snake Game
By mustachMan in forum New To JavaReplies: 2Last Post: 12-10-2009, 10:35 PM -
Snake game movement
By BeerMonkey in forum New To JavaReplies: 9Last Post: 11-27-2008, 12:48 PM


2Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks