Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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: Collision again. Good detection system. on: 2012-09-09 13:00:26
It might work better if you determine the amount of overlap in both directions. Then you can use that data to move the player back the proper amount (instead of always +-3).

Some sample code adapted from my own collision detection scheme:

edit: you can also just remember the old player position and put it back if there was a collision

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  
    // find overlapping box
   int ix1 = Math.max(bx11, bx12);
    int iy1 = Math.max(by11, by12);
    int ix2 = Math.min(bx21, bx22);
    int iy2 = Math.min(by21, by22);

    int swap;

    if(ix2 < ix1)
    {
      swap = ix1;
      ix1 = ix2;
      ix2 = swap;
    }

    if(iy2 < iy1)
    {
      swap = iy1;
      iy1 = iy2;
      iy2 = swap;
    }

    // return if no overlap
   if(ix2 < ix1 && iy2 < iy1)
      return false;

    // width and height of overlapping area
   int iw = ix2 - ix1;
    int ih = iy2 - iy1;

2  Games Center / Showcase / Re: The Gift/Curse of Evolution (Alpha 0.0.2.0) on: 2012-09-08 23:22:27
Sorry dude, it works ok. It would be nice if you could run it in a smaller window.

I am happy to see that people are interested in this game, even if they don't want to leave comments.
lol
3  Games Center / Showcase / Re: The Gift/Curse of Evolution (Alpha 0.0.1.2) on: 2012-09-04 22:21:21
My screen looks like this:


Can move the white square around, that's about it.
4  Games Center / Showcase / Re: Black Sheep on: 2012-09-02 19:45:52
Nice job man, fun game.
5  Games Center / Showcase / Re: Arrow Runner 2.0 on: 2012-09-02 19:41:25
Ran well here (vista 64, 1.6.0_35-b10).

I really enjoyed the game! A simple idea but implemented very well, thanks.

6  Discussions / Miscellaneous Topics / Re: painting tutorial on: 2012-09-02 13:28:27
My bad.
7  Discussions / Miscellaneous Topics / painting tutorial on: 2012-09-02 01:37:53
This is a method of painting computer graphics that I use. The goal is to show how to get reasonably good results without spending too much time. (The example is a title screen background for a centipede-style game I'm working on.)

It's a good idea to save each step, or major change to a separate file so you can go back if you mess up. As you go through this process, keep this rule in mind:

Darker areas are more transparent, highlights are more opaque.

Color Palette
First is the color palette. You don't need a big palette with a lot of colors. I use this 3-level RGB palette because it contains the colors I need:
Click to Play


Use a "Normal" blending mode for all but the final step.

Step 1
Paint the background with light brown. Using dark red, outline your shapes, and perhaps block out really dark areas. The purpose of these colors is to tie the colors of all objects together so they appear to exist in the same environment together.


Step 2
Color in the shadows using the dark red. Add highlights back in with the light brown if you need to.


Step 3
Deepen the shadows with black. (This picture should have more shading but you get the idea.)


Step 4
Start adding gray using a soft brush. Try to make the highlights almost opaque grey, while letting the dark areas show through more. The purpose of the gray is to simulate an indirect, cold light source.


Step 5
Now add white to the highlights to make them brighter.


Step 6
Now color can be added. The dark blue is used for shading, and warmer colors in the highlights.


Step 7
At this point, concentrate on adding small details to the brightest highlights. Use an "Addition" blending mode as is will preserve the color intensity better.

8  Game Development / Performance Tuning / The personal attacks thread. (everything goes) on: 2012-09-02 00:16:46
I removed the semicolons, so I guess its apparent now that I didn't really test it Smiley
9  Game Development / Performance Tuning / Re: Fastest way to determine if two rotated rectangles intersect? on: 2012-09-01 17:24:17
You can project the corners of the two rotated rectangles into 2 polygons, and perform these tests:

1. Does any line from poly1 intersect with any line from poly2?
2. Is any vertex from poly1 inside poly2, or vice-versa?

If either is true, then there is an overlap. This is not expensive to calculate and is accurate.


10  Game Development / Performance Tuning / Re: Point in 2d polygon. on: 2012-09-01 17:10:17
Another way, adapted from some C code I had, only needs 2 multiplies per polygon point:

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  
// incomplete class, example only
// by Joe Davisson

public class Polygon
{
  int px[];
  int py[];
  int pcount;

  public boolean pointIn(int x, int y)
  {
    int i;
    int inside = 0;

    for(i = 0; i < pcount - 1; i++)
    {
      int px1 = px[i];
      int px2 = px[i + 1];
      int py1 = py[i];
      int py2 = py[i + 1];

      if(py1 <= y)
      {
        if((py2 > y) && (((px2 - px1) * (y - py1) - (x - px1) * (py2 - py1)) > 0)
          inside++;
      }
      else
      {
        if((py2 <= y) && (((px2 - px1) * (y - py1) - (x - px1) * (py2 - py1)) < 0)
          inside++;
      }
    }

    if((inside & 1) > 0)
      return true;
    else
      return false;
  }

}


Edit: P.S. this assumes that the last vertex is a copy of the first vertex.

11  Games Center / Showcase / Re: NeoBat with SOUND! on: 2012-09-01 00:07:22
Dig this, has an HDR sort of look to it.

12  Games Center / Showcase / Re: Space Shooter on: 2012-08-31 23:14:57
looks nice
13  Games Center / Featured Games / Re: Daedalus on: 2012-08-31 22:38:38
Looks nice man.

My only complaint is that I actually use the mouse1/mouse2 for forward/backward, so it would be nice to be able to set the fire button to ctrl or whatever.


14  Games Center / Showcase / some games i made on: 2012-08-31 20:46:54
Finished up a game engine and a couple of browser games here:
http://joe.csoft.net

Features:
-rotated/scaled/lit sprites
-sound/music generator
-pixel-perfect collision detection

Some more info: My engine is probably best suited for arcade games that can take advantage of the collision detection. It runs at 125 fps internally so the collisions are real accurate regardless of the actual fps (game logic and rendering are separated).

Screenshots:












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.

atombrot (25 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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!