Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  Game Development / Newbie & Debugging Questions / Re: questions about the threads. help on: 2013-01-17 13:21:55
GOLDEN THREAD RULE!

If you have to ask anything about them of anyone here... don't use them.

Cas Smiley
sorry for the question, cas  Sad

Actually, I appreciate the info you have given me, so I've seen the need to do all the game and see for myself that it is better, if a thread or 4.  Smiley

It seems very convincing  use only one thread but for the music it would have to use another?.
use two or more  handle carries me to consider whether, for example, a single thread that manages counters and the other thread, repaints. The most important (repaints), could not possibly receive resources.
Anyway, I will prove, less overheating and work in an optimum way.

I hope you can help me again, if  questions stupid arise like this.

thank you very much to all and approve what they said
2  Game Development / Newbie & Debugging Questions / Re: questions about the threads. help on: 2013-01-17 05:25:52
Each computer could be updated more quickly than other.

which is better, a Thread or a Timer to measure seconds and so make a good animation,stopwatch, etc...?
3  Game Development / Newbie & Debugging Questions / Re: questions about the threads. help on: 2013-01-15 07:07:07
Assuming that only one thread is used.
My concern is about the speed of the game and if this problem can also be due to the loading of images, even with the buffer should have no problems. Undecided

About the processor, mine is a dual core,
but I prefer the game to work well with computers obsolete. Clueless
4  Game Development / Newbie & Debugging Questions / Re: questions about the threads. help on: 2013-01-14 17:43:42
In general the question of the threads emerged the idea of ​​a double dragon style game.
I had to make a thread for each enemy behavior, considering the shotters (I thought they were more difficult to program).
The processor  began to warm and in linux the game was very slow.
Do you have something to do with the poor implementation of the threads?  Clueless
5  Game Development / Newbie & Debugging Questions / Re: questions about the threads. help on: 2013-01-14 08:14:41
thanks for the replies.
So all that remains is to find a way that works well, the times for the animation, movements, etc.
Ok, I'm going to give it my best and try everything you said.
Thanks again.  Wink
6  Game Development / Newbie & Debugging Questions / Re: questions about the threads. help on: 2013-01-14 07:41:34
thanks for the reply.
I'll read the tutorial.

but, and sorry for the dumb question.
it's about the speed of game.
 loading many images (bullets like Mushihime-Sama) and the method by which the collision is detected (using the method getBounds with fors)
the game would become very slow?
7  Game Development / Newbie & Debugging Questions / questions about the threads. help on: 2013-01-14 07:19:42
Well, my question is, how many threads are used in a complete game?
a single thread to the player ?
a single thread for each enemy ?
thread for coliciones ?
a thread just to repaint the screen?
must be synchronized?
Can overheat the processor?
 Huh

Please, help

8  Game Development / Newbie & Debugging Questions / player becomes slow on: 2012-11-27 00:06:31
good day, guys.
Sorry for my bad english, i am beginner yet.  Undecided
i have one doubt.

I decided create a shooter game like "Mushihime-Sama", not really identic that this but similar, the problem is in the test of paint elements in canvas, paint bullets in a continuous manner causes the player to move slow.

I use bufferstrategy for the level and bufferimage for the elements how the player, background, bullets and enemies. This problem only pass in ubuntu. In windows, the processor work much.

When i painted much elements in canvas, the player will move most slow?

what is the right way to paint In This Case?

PD. sorry if this doubt is already repeated.

CODE:
paint bullets:
1  
2  
3  
4  
5  
6  
7  
public void paintBullets(Graphics2D g){
        if(bullets.size()>0){
        for(int q=0; q<bullets.size(); q++){
            bullets.get(q).paint(g);
        }
        }
    }


1  
2  
3  
4  
5  
public void paint(Graphics2D g){
            if(life>0){
            g.drawImage(img.get(num)[currentFrame], x,y, null);
            }
        }


load img
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public void setSpriteNames(String[] names) { 
      spriteNames = names;
      height = 0;
      width = 0;
                colecImg= new BufferedImage[names.length];
      for (int i = 0; i < names.length; i++ ) {
        BufferedImage image = cargador.getSprite(spriteNames[i]);
        height = Math.max(height,image.getHeight());
      width = Math.max(width,image.getWidth());  
                colecImg[i]=image;
      }
                img.add(colecImg);
   }


CARGADOR
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
protected Object loadResource(URL url) {
      try {
         return ImageIO.read(url);
      } catch (Exception e) {
         System.out.println(" "+url);
         System.out.println("Error"+e.getClass().getName()+" "+e.getMessage());
         System.exit(0);
         return null;
      }
   }
   
   public BufferedImage createCompatible(int width, int height, int transparency) {
      GraphicsConfiguration gc =  GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
      BufferedImage compatible = gc.createCompatibleImage(width,height,transparency);
      return compatible;
   }
   
   public BufferedImage getSprite(String name) {
      BufferedImage loaded = (BufferedImage)getResource(name);
      BufferedImage compatible = createCompatible(loaded.getWidth(),loaded.getHeight(),Transparency.BITMASK);
      Graphics g = compatible.getGraphics();
      g.drawImage(loaded,0,0,this);
      return compatible;
   }
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.

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

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

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

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

Tekkerue (44 views)
2014-09-09 02:24:56

mitcheeb (65 views)
2014-09-08 06:06:29

BurntPizza (48 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (40 views)
2014-09-07 01:11:22

Longarmx (37 views)
2014-09-07 01:10:19
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!