Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (727)
Games in Android Showcase (217)
games submitted by our members
Games in WIP (796)
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 ... 10
 1 
 on: 2017-05-29 16:04:30 
Started by BurntPizza - Last post by Damocles
Worked on an EvE Online like procedural StarCluster Generator.

(JS Version, click to see star-names, drag to tilt starmap)
starmap JS

 2 
 on: 2017-05-29 15:38:38 
Started by tym - Last post by philfrei
Cool visual design.

Is the music heard part of the game? Given the translucent images and particles, and the lightning effects, I think music could be found that was a somewhat better match. It is well written, well produced, I'll give it that. (Maybe just a matter of personal taste--can't please everybody!)

 3 
 on: 2017-05-29 14:21:34 
Started by FabulousFellini - Last post by FabulousFellini
No I am not sure.  I assume it is...but I'm also not sure how to get the library compiled for arm.  Time to google.

 4 
 on: 2017-05-29 14:12:05 
Started by Emmsii - Last post by jonjava
Perhaps s.width / s.height doesn't correspond to the actual tile width/height (not necessarily the same as sprite width/height)

Nevertheless if the error remains constant on all the tiles it's just a small offset issue -- try adding +- offsets to the tiles until you get the correct behavior -- then you will know the actual error offsets in numbers and it might help you pinpoint the actual issue.

 5 
 on: 2017-05-29 08:08:24 
Started by Emmsii - Last post by Emmsii
I'm not doing any screen offset just yet.

This is the sprite I've been using, its 30x15. (Its part of a 64x64 spritesheet, I cut it out at runtime)


When I switch to this sprite, which is 32x32 with the tile on the bottom half, strange things happen.




Edit: I fixed the weird tiles in the last image by changing this line in the rendering code from
1  
int ya = (x + y) * (s.height / 2);

to
1  
int ya = (x + y) * (s.height / 2) / 2;

The mouse collision is still very broken.

Here's a bigger gif. It seems to break on the right half of each tile.
Click to Play

 6 
 on: 2017-05-29 00:42:10 
Started by Emmsii - Last post by jonjava
Seems like a sprite anchoring issue (should be top corner pixel of your isometric sprite) (the first tile top corner should be smack middle on the top left corner of the screen) -- that or screen offset issue.

 7 
 on: 2017-05-28 22:12:34 
Started by Archive - Last post by Archive
I found creating a radar for a 6DOF game quite difficult and there were few resources that I could find online that gave me an idea of what to do, so I'm posting this here in hopes that someone will find this useful.

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  
   private void renderRadar(C3DVideo v) {
      int radius = 75;
      float sensitivity = 100; // the higher the sensitivity, the smoother the rotations are of the dots being drawn on the radar
      float sens_rad = radius * sensitivity;
      int dotRadius = 2;
      int xl = (mode.getWidth() / 2) - 200; // arbitrary circle drawing positions, you can put these where you'd like
      int yl = (mode.getHeight() / 2) + 120; // ^

      v.drawCircle(xl, yl, radius, 0xffffff); // draw circle at xl, yl with given radius and a white color

      v.drawCircle(xl - dotRadius, yl - dotRadius, dotRadius, 0x00ff00);
     
      // the following three lines of code should be modified to create no garbage, but this is up to you.
      float[] ps = new float[] { player.pos_x, player.pos_y, player.pos_z }; // put player position (x,y,z) into float array
      fPlane plt = new fPlane(ps, player.tangent.toArray()); // new plane, 'ps' is the point on the plane, tangent is  normal.
      fPlane plb = new fPlane(ps, player.binormal.toArray()); // new plane, 'ps' is the point on the plane, binormal is normal.
      // tangent vector is the 'forward' vector of the player, and the binormal is the 'left/right' vector of the player
      for (int i = 0; i < targets.size(); i++) {
         Entity e = targets.get(i);
         dotRadius = (int) e.radius / 8; // optional, but this line creates dots on the radar that are scaled so that they reflect the radius of the enemies
         float d1 = plb.pointPlaneDistance(e.pos_x, e.pos_y, e.pos_z); // find distance from entity's position to the binormal plane.
         if (d1 > sens_rad) {
            d1 = sens_rad;
         }
         if (d1 < -sens_rad) {
            d1 = -sens_rad;
         }
         float d2 = plt.pointPlaneDistance(e.pos_x, e.pos_y, e.pos_z); // find distance from entity's position to the tangent plane.
         if (d2 > sens_rad) {
            d2 = sens_rad;
         }
         if (d2 < -sens_rad) {
            d2 = -sens_rad;
         }
         double xc = d1 / sensitivity;
         double yc = -d2 / sensitivity; // negate the y coordinate because of window graphics
         double mag = Math.sqrt(xc * xc + yc * yc);
         // Scale vector to meet the radius if the magnitude of the vector is larger than the radius
         if (mag > radius) {
            xc  /= mag;
            yc /= mag;
            xc *= radius;
            yc *= radius;
         }
         v.drawCircle(xl + (int) xc - dotRadius, yl + (int) yc - dotRadius, dotRadius, 0xff0000); // draw entity dot on radar
      }
   }


Picture of it in game

 8 
 on: 2017-05-28 21:08:29 
Started by Ecumene - Last post by Ecumene

New weapon GUI! (Based somewhat on Half-Life)

and..
Click to Play


Throwable weapons!
In this gif they actually looped around the arena and I caught them again after.

I plan to control the throwing speed by the scroll wheel (Alt + wheel to pull it back, and throw it with more speed)

 9 
 on: 2017-05-28 18:07:57 
Started by FabulousFellini - Last post by princec
Are you sure it's not that the jinput library you've got there is compiled for x86 rather than ARM?

Cas Smiley

 10 
 on: 2017-05-28 17:05:52 
Started by Emmsii - Last post by Emmsii
I've been messing around with drawing isometric tiles and I'm a bit stuck on mouse collisions. I found this article on isometric tiles: http://clintbellanger.net/articles/isometric_math/

Here's my rendering code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
 for(int x = 0; x < map.width(); x++){
   for(int y = map.height(); y >= 0; y--){
      Sprite s = map.getSpriteAt(x, y);

        int xa = (x - y) * (s.width / 2);
        int ya = (x + y) * (s.height / 2);

        Point p = mouseToIsoTile(mx, my, s.width, s.height);
        if(p.x != x || p.y != y) screen.renderSprite(s, xa, ya);
    }
}


The onTile() methods takes in the mouse x,y coords as well as the sprite width and height.

Here's the onTile() method:
1  
2  
3  
4  
5  
public Point onTile(int xa, int ya, int width, int height){
   int x = (xa / (width / 2) + ya / (height / 2)) / 2;
   int y = (ya / (height / 2) - (xa / (width/ 2))) / 2;
   return new Point(x, y);
}


When I run the code to hide the tile below the mouse I get this:
Click to Play

You can see the hidden tile is somewhat accurate, but it seems off and I cant seem to figure out why.

Pages: [1] 2 3 ... 10
 
Archive (299 views)
2017-04-27 17:45:51

buddyBro (486 views)
2017-04-05 03:38:00

CopyableCougar4 (933 views)
2017-03-24 15:39:42

theagentd (947 views)
2017-03-24 15:32:08

Rule (955 views)
2017-03-19 12:43:22

Rule (924 views)
2017-03-19 12:42:17

Rule (925 views)
2017-03-19 12:36:21

theagentd (988 views)
2017-03-16 05:07:07

theagentd (903 views)
2017-03-15 22:37:06

theagentd (696 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!