Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  Games Center / 4K Game Competition - 2010 / Re: FortressFall4k on: 2010-03-26 12:05:21
http://users.atw.hu/cppanddelphi/fortressfall4k/physicstest.zip

Delphi source of my engine.

I have chosen Delphi because in Java I unable to use BiasedAngularVelocity properly, my game ignore it, but in Delphi it works fine. I did not search what is the reason since I had not time to reveal the solution.

The engine is really a mix of 2 ones, Box2d and Chipmunk engines, but collision detection is significant changed and different.
2  Games Center / 4K Game Competition - 2010 / Re: RESULTS!!! on: 2010-03-23 16:45:17
Every participants has proven that less is more when submitted a game. I have to admit it was a brilliant competition.

Thanks for everone who supported my game during voting procedure, judges and community too!!

I hoped that somebody would use my code to create another physics game. I took Chipmunk rigid body engine what I could simplify enough for the contest.

I would like to release C++ and/or Delphi source soon, because Java code really hard to understand.
3  Games Center / 4K Game Competition - 2010 / Re: Geometry 4k on: 2010-02-24 15:04:18
Ah thanks, which year is it submitted?

Last year. That was the first occasion when I submited a game in 4k. When I was a child there were few game machine, especially in Hungary. The first game what I played was Asteroids, with monochrome screen and loudy noise effects.
4  Games Center / 4K Game Competition - 2010 / Re: Driver4K on: 2010-02-23 13:34:03
Great game. Cool

May I realized well that you used my physics? If so was it a big effort to figure out my code? I tried to give lot of explanation.
5  Games Center / 4K Game Competition - 2010 / Re: Geometry 4k on: 2010-02-23 13:24:42
This game is similar my first java4k game but much better. There are lot of enemies threatening from everywhere. I think most dangerous are blue boxes which approaching the ship fast and very lethal manner.

Can one upgrade weapon of the ship any way?
6  Games Center / 4K Game Competition - 2010 / Re: FortressFall4k on: 2009-12-30 16:39:18
I have updated my game. Now you can play 10 new levels and shot count restriction implemented too.

Happy New Year for everbody!
7  Games Center / 4K Game Competition - 2010 / Re: FortressFall4k on: 2009-12-18 10:56:51
Great game, very fun. Would be more satisfying if the cannon balls could be fired in a semi-automatic fashion, and the cannon balls remained after firing.

Thank you too.

I am afraid I do not really know what semi-automatic fashion means exactly.

The game uses only 32 bodies, I do not allow to leave about cannon balls everywhere because I need to draw structures as well.
8  Games Center / 4K Game Competition - 2010 / Re: FortressFall4k on: 2009-12-18 10:03:51
That's a shame, as the first level can get a bit tricky if one of the yellow blocks ends up in a big pile in the middle. I think an easier first level would be good.

Great concept though, the physics has given it the WOW factor for me.

Thank you, but I am on hurry until next week. At the 1st level you should avoid that yellow blocks be a part of a pile.
9  Games Center / 4K Game Competition - 2010 / Re: TR4KS on: 2009-12-16 11:21:21
I like this train game. Maybe the mouse control will be better choice than keyboard control because the train is moved fast enough. The animation is not so smooth, pixel movement of train would be humane for eyes.
10  Games Center / 4K Game Competition - 2010 / Re: FortressFall4k on: 2009-12-16 09:07:32
Here is the source.

http://users.atw.hu/cppanddelphi/fortressfall4k/N.java

I do not want to modify levels now, but I think there is enough room for shot checking. I will implement it soon.
11  Games Center / 4K Game Competition - 2010 / FortressFall4k on: 2009-12-15 18:51:24
First of all thank you for watching and playing my little game.

I got an opinion in reference to my game. Since I did not use pack200 you can not wait wonder. But I was wonder what can I stuff to the game without pack200.

This is not the only game, which I would like to submit during the competition. This is just an experience to show my physics engine.

If I released the source code everyone would write his very own physics game. This would be a great challenge. But I do not know what the rules allow.

 
12  Games Center / 4K Game Competition - 2011 / Re: Java 4k Resources Thread on: 2009-12-02 14:48:49
Thanks. Me. Yes.


I bet I can improve it further, as I'm currently not even using an obfuscator to shrink the method/field names.

Thank you.

By the help of this tool I can finally create my jar file easily. I had a big problem with compression until now.
13  Games Center / 4K Game Competition - 2011 / Re: Java 4k Resources Thread on: 2009-12-02 12:28:01
Compile 'n Shrink - HTTP Service

http://www.indiespot.net/app/java-four-kay

Fantastic!!! Cool Who maintains this site? Is it a permanent project?
14  Games Center / 4K Game Competition - 2009 / Re: Flash 4K on: 2009-06-02 09:22:51
I have created my first Flash game, and I think it is better than the Java version. I mean it is much simpler for me to develop the game.

Look at this:

http://cppanddelphi.atw.hu/asteroids/game.htm

My problem was the compression with Java games. I only could use ProGuard, nothing else. The swf files are compressed automaticaly, so it was a big relief. I could use more classes as well and the source code is legible too.

15  Games Center / 4K Game Competition - 2009 / Re: 4k review swap? on: 2009-03-16 14:00:43
QuadSquad4k

This game seems very buggy.  My ship seems unaffected when it collides with quads.  Why didn’t you create asteroid shaped objects?  Why quads?!  The game entered some sort of infinite loop where it kept resetting.  How do I slow down my ship?



You seems like a curious little boy, who are always asking his parents.  Smiley

Collision detection scans every points of the ship whether is in any quad or not. Of course exact solution will be that scan points of the ship and scan points of quads. This latter examination is missing.

4k game 4 sides objects. The real reason is that I did not compress the jar file because I did not know some compression method. This is my first Java game and I tried to write a game without compressing.

Infinite loop? What kind of situation did you detect it?

Ship is easily decelerating. It has a velocity vector, just turn the nose of your ship against the vector and accelerate.
16  Games Center / 4K Game Competition - 2009 / Re: Grasshopper4k on: 2009-02-19 12:59:42
Thank you very much. I will complete the code soon.
17  Games Center / 4K Game Competition - 2009 / Re: Grasshopper4k on: 2009-02-19 10:20:06
I am afraid cylab I do not know what is the problem.

Perhaps run the program without antialiasing.
18  Games Center / 4K Game Competition - 2009 / Re: Grasshopper4k on: 2009-02-18 16:51:47
First of all the surface, the particle and the constraint parts should remain unchanged. These are essential parts.

One can create model structure on simple way.

See the variables

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  
 // Surfaces (n pieces depends terrain)
 private float[][] S = new float[65535][6];
  // 0 = point1X
 // 1 = point1Y
 // 2 = point2X
 // 3 = point2Y
 // 4 = surface normal X
 // 5 = surface normal Y

  // Particles (7 pieces)
 private float[][] P = new float[7][14];
  // 0 = is active
 // 1 = current position X
 // 2 = current position Y
 // 3 = previous position X
 // 4 = previous position Y
 // 5 = effective force X
 // 6 = effective force Y
 // 7 = particle radius
 // other auxiliary variables
 // 8 = tempX
 // 9 = tempY
 // 10 = closestPointX
 // 11 = closestPointY
 // 12 = correctionX
 // 13 = correctionY

  // Constraints (18 pieces)
 private float[][] C = new float[18][4];
  // 0 = index1
 // 1 = index2
 // 2 = restlength
 // 3 = stiffness


If you create a surface just give 2 points. Be careful, the normal of surface determines a half plane. A surface is effective if the the particle is on the same side of this half plane. Particles and constraints should be above the surfaces.

If you create a particle just give a particle number, x and y coordinates and a radius. Every particle is active by default. In the given code the first particle not active, so collision detection skip it.

If you create a constraint just give a constraint number and particles number, between these particles the constraint is situated. At last the stiffness value.

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  
    particleCreate(0, -65,  -30, 1.15f);
    particleCreate(1,   0,  -30, 0.5f); P[1][0] = 0;
    particleCreate(2,  65,  -30, 1.15f);
    particleCreate(3,  65,  -70, 0.85f);
    particleCreate(4,  30, -100, 1.15f);
    particleCreate(5, -30, -100, 1.15f);
    particleCreate(6, -65,  -70, 0.85f);

    constraintCreate(0, 0, 1, 0.25f);
    constraintCreate(1, 1, 2, 0.25f);
    constraintCreate(2, 2, 3, 0.25f);
    constraintCreate(3, 3, 4, 0.25f);
    constraintCreate(4, 4, 5, 0.25f);
    constraintCreate(5, 5, 6, 0.25f);
    constraintCreate(6, 6, 0, 0.25f);

    constraintCreate(7, 0, 3, 0.15f);
    constraintCreate(8, 0, 4, 0.15f);
    constraintCreate(9, 0, 5, 0.15f);
    constraintCreate(10, 1, 3, 0.15f);
    constraintCreate(11, 1, 4, 0.15f);
    constraintCreate(12, 1, 5, 0.15f);
    constraintCreate(13, 1, 6, 0.15f);
    constraintCreate(14, 2, 4, 0.15f);
    constraintCreate(15, 2, 5, 0.15f);
    constraintCreate(16, 2, 6, 0.15f);
    constraintCreate(17, 3, 6, 0.15f);


One engine step is fulfilled the following way. Go through all particles and constraints with particleVerlet() and constraintResolve() procedure.

Finally check particles and surfaces collision. If there are a lot of surface then collision detection is very time consuming. It worths to perform some space partitioning procedure.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
        int delta = (int) (System.currentTimeMillis() - lastLoopTime);
        lastLoopTime = System.currentTimeMillis();

        for (k = 0; k < delta / 15; k++)
        {
          // timestep
         for (i = 0; i < 7; i++)  // particles (7)
           particleVerlet(i);
          for (i = 0; i < 18; i++)  // constraints (18)
           constraintResolve(i);
          for (j = 0; j < surfaceCount; j++)  // surfaces (surfaceCount)
           for (i = 0; i < 7; i++)  // particles (7)
             particleCheckCollision(j, i);
        }


One thing is missing. The forces.
Forces must take effect parallel with vector which indicate form point 0 to point 2.

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  
  private void HandleKeyEvent()
  {
    float dist, vX, vY;

    dist = (float)distance(P[0][1], P[0][2], P[2][1], P[2][2]);
    vX = (P[2][1] - P[0][1]) / dist;
    vY = (P[2][2] - P[0][2]) / dist;

    if (K[KeyEvent.VK_UP])
    {
      P[0][5] = vX * 2.75f;
      P[0][6] = vY * 2.75f;
      P[2][5] = vX * 2.75f;
      P[2][6] = vY * 2.75f;
    };
    if (K[KeyEvent.VK_DOWN])
    {
      {
        P[0][5] = vX * -1.75f;
        P[0][6] = vY * -1.75f;
        P[2][5] = vX * -1.75f;
        P[2][6] = vY * -1.75f;
      }
    };
    if (! K[KeyEvent.VK_DOWN] && ! K[KeyEvent.VK_UP])
    {
      P[0][5] = 0;
      P[0][6] = 0;
      P[2][5] = 0;
      P[2][6] = 0;
    };
  }


19  Games Center / 4K Game Competition - 2009 / Grasshopper4k on: 2009-02-18 10:02:14


I always wanted to write some car racing game. Not really small size game, but finally this is the issue. Now everyone can create a game with an almost realistic car. I got the idea from APE engine however I simplified collision detection because it was too difficult.

Until deadline 10 days have remained yet. Try to write a better game, for instance  better car or terrain generation etc.

http://users.atw.hu/cppanddelphi/grasshopper4k/A.java

See below the physics model. Joints and constraints. Maybe this is the best arrangement, but you can experience with the structure.

Click to Play
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.

Pippogeek (35 views)
2014-09-24 16:13:29

Pippogeek (28 views)
2014-09-24 16:12:22

Pippogeek (17 views)
2014-09-24 16:12:06

Grunnt (40 views)
2014-09-23 14:38:19

radar3301 (23 views)
2014-09-21 23:33:17

BurntPizza (58 views)
2014-09-21 02:42:18

BurntPizza (29 views)
2014-09-21 01:30:30

moogie (34 views)
2014-09-21 00:26:15

UprightPath (47 views)
2014-09-20 20:14:06

BurntPizza (51 views)
2014-09-19 03:14:18
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!