Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Game scoreboard  (Read 1533 times)
0 Members and 1 Guest are viewing this topic.
Offline cgru2

Junior Newbie





« Posted 2005-10-19 08:33:41 »

Hi..

Im making this Mario Brother's dtyle game and im looking to add a high score board at the end of each game.

I want it to appear on top of the graphics in the main screen.

Anyone has any documentation or ideeas on how it could be done?

Cheers
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #1 - Posted 2005-10-19 09:39:34 »

what are you using to render your graphics java2d, opengl or something else?
Offline Jeff

JGO Coder




Got any cats?


« Reply #2 - Posted 2005-10-19 21:41:51 »

Typically such things are done in games by using the same render engine yo uuse for your "sprites".  The Scorebaord is a big sprite, and each digit is a 'sprite' on top of it.

Alternately, you could draw the scoreboard offline into an offscreen buffer and display the whole thinsgas  one sprite within your engine.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cgru2

Junior Newbie





« Reply #3 - Posted 2005-10-20 02:59:39 »

Im using java 2d
Offline g666

Junior Member





« Reply #4 - Posted 2005-10-26 20:09:48 »

you could do it by communicating  with a php script writing to a flat text file. Ill post sample code if u want.

desperately seeking sanity
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #5 - Posted 2005-10-27 02:19:10 »

I actually made a networked Mario back in the day.  Cool

Here was my method for drawing the score on the top of the screen. Is this what you were looking for?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
private void drawScore(Graphics g)
   {
      g.setColor(Color.WHITE);
      g.setFont(new Font("Courier New", Font.BOLD, 22));
      g.drawString("MARIO", 10 + getWidth()/4 * 0, 22);
      g.drawString("COINS", 10 + getWidth()/4 * 1, 22);
      g.drawString("WORLD", 10 + getWidth()/4 * 2, 22);
      g.drawString("TIME" , 10 + getWidth()/4 * 3, 22);
      g.drawString("  " + mario.score(), 10 + getWidth()/4 * 0, 40);
      g.drawString("  " + mario.coins(), 10 + getWidth()/4 * 1, 40);
      g.drawString(" " + level.toString(), 10 + getWidth()/4 * 2, 40);
      g.drawString(" " + level.timeLeft(), 10 + getWidth()/4 * 3, 40);
   }

See my work:
OTC Software
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (10 views)
2014-09-21 23:33:17

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (18 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (46 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!