Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2007, 10:57 PM
Member
 
Join Date: Jul 2007
Posts: 40
lenny is on a distinguished road
Help with my game in java
I'm trying to make a game using java like minesweeper.
where it's on a grid and you have to find random squares.
I'm also imposing a 5 click limit until game over.
If you hit the gold within that time, you win, and if you hit the coal, you lose (yellow and black squares).
Only thing is, despite all my attempts with for statements and if statements, I can't seem to get it working and I'm tearing my hair out!

Code:
{ // Counts to 5 mouse clicks then if no gold or coal found it will say GAME OVER! int i; for (i=0; i<=5; i=i+1) System.out.println("GAME OVER!"); }
Code:
int i; if (i < 5) { // Don't interrupt game (less than 5 clicks) System.out.println(""); i++; } else { System.out.println("GAME OVER!"); }
Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2007, 05:40 PM
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
Where's the GUI codes for ur game lenny?
Code:
// Counts to 5 mouse clicks then if no gold or coal found it will say GAME OVER! int i; for (i=0; i<=5; i=i+1) System.out.println("GAME OVER!"); }
If u write it that way, isn't it going to print GAME OVER each time u click the mouse?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with game applet in java barney Java Applets 3 02-13-2008 06:26 AM
Java Battleship Game Help PLEASE mars_red New To Java 0 02-12-2008 02:09 AM
Java BattleShip game help mars_red Advanced Java 0 02-12-2008 01:58 AM
Implementing "Game Over" in Minesweeper game based on Gridworld framework. JFlash New To Java 0 11-16-2007 12:02 AM
Help with java text game silvia New To Java 6 07-27-2007 07:58 PM


All times are GMT +3. The time now is 10:04 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org