Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / J2ME / Handling different display sizes on: 2005-08-05 07:07:52
Hello,
I wonder how my game can handle different display sizes.

In desktop game, we can set fullscreen to a standard resolution (800x600).

Mobiles have an standard resolution?
Which is the best way to handle this?
2  Java Game APIs & Engines / J2ME / Re: Constant Frame Rate on: 2005-08-05 07:01:17
I tried it, but I expect 16fps and I get up to 30fps  Undecided.

Well, I suspect its because this resturns milis, not nanos...  Sad
3  Java Game APIs & Engines / J2ME / Re: Constant Frame Rate on: 2005-08-04 07:17:09
I don't know how  Undecided.

With J2ME I use System.nanoSeconds(), but J2ME doesn't have it.
Any example J2ME game loop  Huh

Thanks!
4  Java Game APIs & Engines / Tools Discussion / Re: compiling resources? on: 2005-07-27 08:14:29
yes, I know there's no practical way.

I just like to prevent the "casual thief"  Smiley.
5  Java Game APIs & Engines / Tools Discussion / Re: compiling resources? on: 2005-07-27 03:09:06
I never heard about 64Kb limit, thanks!

BTW, Im trying to find a way to encrypt my resources.
6  Java Game APIs & Engines / Tools Discussion / compiling resources? on: 2005-07-27 01:01:08
Hello again, I used to compile my resources when I was programming in c++.
I mean, convert resources files (images, etc...) to .cpp files (.java this time).

Is there something to do it in the standard api?
7  Java Game APIs & Engines / Tools Discussion / obsfucators on: 2005-07-27 00:45:18
Hi, I like to use an obsfucator (free), which do you recommend?
8  Java Game APIs & Engines / Java 2D / Re: Image stretch on: 2005-07-25 03:23:37
It creates a new image object  Undecided?.

Is there a way to draw an scaled image directly on the graphics?
9  Java Game APIs & Engines / Java 2D / Image stretch on: 2005-07-25 02:44:44
I googled a lot, but I couldn't it  Undecided.

I need to draw my image into a Graphics2D using linear interpolation:
I need something like:
1  
myGraphics2d.stretchImage(myImage,0,0,myImage.getWidth()*2,myImage.getHeight()*2);


There's a drawImage() method, but it doesn't stretch the image using linear interpolation.
10  Game Development / Game Play & Game Design / Re: Main Loop on: 2005-07-22 20:48:38
cool, I'll take a look   Cheesy.
11  Java Game APIs & Engines / J2ME / Re: Constant Frame Rate on: 2005-07-22 20:45:44
...thanks again
12  Java Game APIs & Engines / J2ME / Re: Future of J2ME on: 2005-07-22 20:45:23
Thanks for your reply.
13  Java Game APIs & Engines / J2ME / Constant Frame Rate on: 2005-07-22 04:07:34
Hello again, I have another question.

Some small devices are faster than others, this will affect my game fps or it is handled (somehow) by J2ME?.
14  Java Game APIs & Engines / J2ME / Future of J2ME on: 2005-07-22 04:04:36
Hello, Im new with small devices programming.

While I was reading some info about J2ME, I thought something;
in the future small devices will be able to run the standar java virtual machine, right?.

This "future" it's far or near?

15  Game Development / Game Play & Game Design / Re: Main Loop on: 2005-07-22 03:54:20
oh, then I can't use these libs  Sad.

Well, anyway, that space invaders tutorial explains what I was looking for,
Thanks again!
16  Game Development / Game Play & Game Design / Re: Main Loop on: 2005-07-21 21:56:27
THANKS A LOT!

you help me a lot.
I like something simple, I write 2d games.
These libs JInput, JOGL, LWJGL are 100% portable, right?.
17  Game Development / Game Play & Game Design / Re: Main Loop on: 2005-07-21 20:58:09
Thanks for your reply  Smiley.

Now I need:
1) Catch inputs events and store them.
2) Double Buffer
3) Run the game at constant rate

1) For the key events, I store each key state in a variable, set it true when its pressed and false when its released?. How is the best mechanism?
The only way to "listen" those events is implementing the Component interface? (The only way I know to read inpur is with Component addKeyListener. Is there another way?)

2) this is ok?:
class Screen extends JPanel {
   Image buffer = createImage(300,200);
   public getGraphics getGrapchis() { return buffer.getGraphics(); }
   public void flush() { buffer.dispose(); }
}

3) What should I use for run the game a constant rate?, should I use Threads?
EDIT
I don't like to use extensions, there isn't another way?  Undecided


18  Game Development / Game Play & Game Design / Main Loop on: 2005-07-21 20:07:48
Hello people!,
I was programming games in c++, and now Im moving to Java world  Grin.

In my game design, I use a GameContext interface:
1  
2  
3  
4  
5  
6  
public interface GameContext {
  public void start();                         // called by GamePlayer
 public void logic(InputEvents i); // InputEvents are all my game inputs
 public void render(Screen s);    // Screen is another class from my package
 public void end();                          // called by GamePlayer
}


And a GamePlayer, that plays the GameContext:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
class GamePlayer {
  public void play(GameContext g) {
     g.start();
     // game loop
      g.logic(InputEvents.getInstance());
       g.render(Screen.getInstance());
     // end loop
    g.end();
  }
  public void stop() { /* code */ }
}


My question is how the main game loop is coded in java, which classes should I use, and how?.
(I already now the FPS and that stuff, but I don't know how to code it, the API is huge!!!  Smiley)
I read some books and tutorials, but they are old or very confusing  Undecided.

Thanks in advance!
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (20 views)
2014-04-15 18:08:23

BurntPizza (16 views)
2014-04-15 03:46:01

UprightPath (29 views)
2014-04-14 17:39:50

UprightPath (14 views)
2014-04-14 17:35:47

Porlus (30 views)
2014-04-14 15:48:38

tom_mai78101 (55 views)
2014-04-10 04:04:31

BurntPizza (112 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!