Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4 5 ... 10
 21 
 on: 2013-05-19 00:32:01 
Started by Agro - Last post by Agro
Alright, so the weekly update! Cheesy

Changelog:
- Added sphere-plane intersection for walls, floors, and ramps
- Added kages
- Added basic spawning
- Optimized rendering
- Added sentry guns
- Redesigned trees
- Added retrievable ammo





 22 
 on: 2013-05-19 00:10:32 
Started by ReBirth - Last post by princec
I ain't migratin' from Eclipse. They can bite my shiny metal ass.

Cas Smiley

 23 
 on: 2013-05-19 00:04:31 
Started by timeaisis - Last post by HeroesGraveDev
10% interpolation is a good idea.

 24 
 on: 2013-05-18 23:53:05 
Started by timeaisis - Last post by DeadlyFugu
From my experience, sending them every frame probably isn't as bad as you think, unless you're really strained for resources, e.g. making an MMO (In which case you should probably use something faster than Kryonet).

You should probably try and send around 6-10 packets a second. To counteract the jumpy-ness this causes you should probably use some sort of interpolation. You can do linear interpolation, but I find something like the following is sufficient:

public void clientUpdate() {
   draw_x += (msg_x-draw_x)/10;
   draw_y += (msg_y-draw_y)/10;
}

Where msg_x and msg_y are the last known location of the object, according to server messages, and draw_x and draw_y are the location you want to use for drawing. You may need to change the 10 at the end to suit how often you receive messages - Use a higher number if the time between messages is longer, use a lower number if it's shorter.

 25 
 on: 2013-05-18 23:42:55 
Started by Andre Lopes - Last post by Andre Lopes
I cleaned the class a little, to go back to the original.

Heres the result :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
package Atlas;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class Explosions {

    private static final int FRAME_COLS = 8;
    private static final int FRAME_ROWS = 6;
    Animation walkAnimation;
    Texture walkSheet;
    TextureRegion[] walkFrames;
    SpriteBatch spriteBatch;
    TextureRegion currentFrame;
    float stateTime;

    private int textureWidth,textureHeight;
   
    public Explosions() {
     
        walkSheet = new Texture(Gdx.files.internal("Explosion2spritesheet.png"));

        TextureRegion[][] tmp = TextureRegion.split(walkSheet, walkSheet.getWidth() / FRAME_COLS, walkSheet.getHeight() / FRAME_ROWS);

        walkFrames = new TextureRegion[FRAME_COLS * FRAME_ROWS];
        int index = 0;
        for (int i = 0; i < FRAME_ROWS; i++) {
            for (int j = 0; j < FRAME_COLS; j++) {
                walkFrames[index++] = tmp[i][j];
            }
        }

        walkAnimation = new Animation(0.025f, walkFrames);
        spriteBatch = new SpriteBatch();
        stateTime = 0f;
       
        //Width ¨¨ Height
       textureWidth = (walkSheet.getWidth() / FRAME_COLS);  
        textureHeight = (walkSheet.getHeight() / FRAME_ROWS);
       
    }
   
   
    public TextureRegion getCurrentFrame()
    {
        stateTime += Gdx.graphics.getDeltaTime();                  
        currentFrame = walkAnimation.getKeyFrame(stateTime,false);  
       
        return currentFrame;
    }


    public int getTextureWidth()
    {
     return textureWidth;
    }

    public int getTextureHeight()
    {
     return textureHeight;
    }
   
   
   
   
   
}



So , i have some ideas...
One would make this class as a model, and create an explosion class and create an arrayList at gameupdate with the state and explosions positions, and keep drawing....

Well, i guess thats the only idea.

Btw, should i make an Atlas for just this img ?

 26 
 on: 2013-05-18 23:33:12 
Started by kpars - Last post by matheus23
Awesome! understood that, really awesome...! Smiley

Do those axis vectors need to be normalized, or is it okay to have them un-normalized, or what would be the effect of having them big? The values scale?
So If I have Vec(10, 0) for x and Vec(0, 10) for y, and I'd convert Vec(1, 1), I'd get Vec(10, 10)? (scaled?)

 27 
 on: 2013-05-18 23:17:23 
Started by Bassex96 - Last post by Bassex96
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
   
   public void checkBrickCollision()
   {
      for (int i=0;i<level.brickCount;i++) {
           
            if (level.bricks[i].GetVisible() == true) {
               if (level.bricks[i].getRect().overlaps(ball.getRect()))
               {
     
         
         
         
         
         boolean cx = Math.abs(ball.getRect().x - level.bricks[i].getRect().x) <= Math.abs(ball.getRect().width + level.bricks[i].getRect().width);
               
         boolean cy = Math.abs(ball.getRect().y - level.bricks[i].getRect().y) <= Math.abs(ball.getRect().height + level.bricks[i].getRect().height);
                 
         if (cx)
         {
             // Collision on top or bottom, reverse y velocity
           
             ball.ballSpeedY = -ball.ballSpeedY;
             Score score = new Score(level.bricks[i].getScore(),(int)level.bricks[i].brickRect.x,(int)level.bricks[i].brickRect.y);
             scoreList.add(score);
             level.bricks[i].Destroy();
             //level.brickCount--;
            System.out.println("Top/Bottom X: " + cx + " Y: " + cy);
             
             return;
         }
     
     
         if (cy)
         {
             // Collision on left or right, reverse x velocity
           
            ball.ballSpeedX = -ball.ballSpeedX;
             
             Score score = new Score(level.bricks[i].getScore(),(int)level.bricks[i].brickRect.x,(int)level.bricks[i].brickRect.y);
             scoreList.add(score);
             level.bricks[i].Destroy();
             //level.brickCount--;
            System.out.println("Left/Right X: " + cx + " Y: " + cy);
             
             return;
         }
         
               //level.brickCount--;
       
               }      
   }
}
}



 28 
 on: 2013-05-18 23:11:55 
Started by Bassex96 - Last post by HeroesGraveDev
Can we see the new code?

 29 
 on: 2013-05-18 23:09:25 
Started by Bassex96 - Last post by Bassex96
I'm still getting the same issue.

I took a screen record of it, forgive my crappy recording software, very choppy.

Fast forward to around :39 and youll see part of what i'm talking about.

http://www.youtube.com/watch?v=Ttqe6OfC32w&feature=youtu.be

 30 
 on: 2013-05-18 23:00:51 
Started by wreed12345 - Last post by wreed12345
I think this game is headed in more of an RPG direction then I originally intended. The whole free roaming concept isn't really doing it for me. I was in a google hangout with my friend and we came up with some ideas which you can view here: http://goo.gl/DCq38 All input is welcome.

Pages: 1 2 [3] 4 5 ... 10
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (34 views)
2013-05-17 21:29:12

alaslipknot (42 views)
2013-05-16 21:24:48

gouessej (72 views)
2013-05-16 00:53:38

gouessej (71 views)
2013-05-16 00:17:58

theagentd (79 views)
2013-05-15 15:01:13

theagentd (74 views)
2013-05-15 15:00:54

StreetDoggy (116 views)
2013-05-14 15:56:26

kutucuk (139 views)
2013-05-12 17:10:36

kutucuk (140 views)
2013-05-12 15:36:09

UnluckyDevil (148 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.32 seconds with 17 queries.