Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
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-12-14 23:33:36 
Started by BurntPizza - Last post by FabulousFellini
Did some more work on my game.
<a href="http://www.youtube.com/v/oxdzuHwnB9s?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/oxdzuHwnB9s?version=3&amp;hl=en_US&amp;start=</a>

Lookin good man!

 2 
 on: 2017-12-14 22:59:34 
Started by BurntPizza - Last post by kingroka123
Did some more work on my game.
<a href="http://www.youtube.com/v/oxdzuHwnB9s?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/oxdzuHwnB9s?version=3&amp;hl=en_US&amp;start=</a>

 3 
 on: 2017-12-14 22:29:04 
Started by buddyBro - Last post by buddyBro
Here's the fix I promised for the getting stuck on corners. The issue was just too large of an epsilon (I was using 1) when trying to determine when to turn the corner. So basically, when the character reached within 1 unit of the node, it would move on to the next corner, but that was way too large, I'm using 0.1 now.

Click to Play


@theagentd, yes non-vertical/horizontal walls in a grid-system would produce a lot of nodes with this algorithm. I wonder if we added the notion of major and minor nodes, where a nodes, where major are the one's diagonal from walls, and minor nodes are the one's both diagonal and adjacent from walls; then for pathfinding we use only major nodes for pathfinding, unless we get stuck. I think this might work, since an optimal path would not be dipping into the cracks of the diagonal walls.

@CommanderKeith, that is very helpful, my next steps are to add a lightning system. Such as the characters can only see the parts they have line of sight for; the human can only see x units with light turned off, and y units with light turned on; the monster can see in dark just fine; but if the human turns on light, then the monster may see the light cast by the human. I'll definitely take a look at those posts to see what kind of optimizations I can do for this lighting system.

 4 
 on: 2017-12-14 21:59:21 
Started by bornander - Last post by bornander
To implement one-way platforms (that is a platform the player can jump up through, but will not fall down through) I hook into the Box2D contact listener.
My game entities can be either Contactable or Collidable, they're both sort of similar but have slightly different capabilities:
  • Contactable
    The entities are notified when a contact occurs, at which point they're given the other object and their Fixture that was involved in the contact.
  • Collidable
    The entities are notified when a collision occurs and can tell Box2D to cancel the collision before any collision response have been applied.
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  
      world.setContactListener(new ContactListener() {
         @Override
         public void preSolve(Contact contact, Manifold oldManifold) {
            Fixture fixtureA = contact.getFixtureA();
            Fixture fixtureB = contact.getFixtureB();
           
            Object userObjectA = fixtureA.getUserData();
            Object userObjectB = fixtureB.getUserData();
           
            boolean disableContact = false;
            if (userObjectA instanceof Collidable)
               disableContact |= ((Collidable)userObjectA).collides(userObjectB);

            if (userObjectB instanceof Collidable)
               disableContact |= ((Collidable)userObjectB).collides(userObjectA);
           
            contact.setEnabled(contact.isEnabled() && !disableContact);
         }
         
         @Override
         public void postSolve(Contact contact, ContactImpulse impulse) {
            contact.setEnabled(true);
         }
         
         @Override
         public void endContact(Contact contact) {
         }
         
         @Override
         public void beginContact(Contact contact) {
            Fixture fixtureA = contact.getFixtureA();
            Fixture fixtureB = contact.getFixtureB();
            Object userObjectA = fixtureA.getUserData();
            Object userObjectB = fixtureB.getUserData();
           
            if (userObjectA instanceof Contactable)
               ((Contactable)userObjectA).handleContact(fixtureA, userObjectB);

            if (userObjectB instanceof Contactable)
               ((Contactable)userObjectB).handleContact(fixtureB, userObjectA);        
         }
      });


Using these interfaces the Player entity can check when the collision occurs if it is with a part of the terrain that has been marked as one-way, and if it is, cancel it.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
         if (terrain.isOneWay()) {
            if (isFallThroughOneWayPlatformsEnabled())
               return true;
           
            if (isMovingUp())
               return true;
            else {
               float py = body.getPosition().y;
               float ty = terrain.getVerticalPosition();
               boolean playerCenterIsBelowTerrain = py < ty;
               
               if (playerCenterIsBelowTerrain)
                  return true;
               else {
                  boolean playerCenterIsMostlyAboveTerrain = py - ty < Player.bodyRadius * 0.975f;
                  if (playerCenterIsMostlyAboveTerrain)
                     return true;
               }
            }
         }


It requires a bit of logic to determine if the Player is sufficiently above the platform (in my case 2.5% of the size radius of the player)  to enable it, also to allow the player to drop down through a platform on command.

I thought it would be tricky to-get one-way platforms to work but it turned out to be a lot easier than dealing with other edge-cases of the implementation.

 5 
 on: 2017-12-14 21:07:42 
Started by Apo - Last post by Apo
Day 14: Wrapping Paper

Move and fold paper strips by dragging them with the mouse.
Use them to join dots placed on the screen.

Solve 15 levels to get the hint of the day.


 6 
 on: 2017-12-14 19:48:27 
Started by princec - Last post by ral0r2
I'm not sure what's going on in this thread but the excitement of everyone in here makes me excited too lol

+

I'm a daily lurker as well Cheesy

 7 
 on: 2017-12-14 18:58:36 
Started by orangepascal - Last post by Gjallar
Does the iOS version differ from the steam version in any way? I'm wondering what makes you charge 10$ more for the steam version.

 8 
 on: 2017-12-14 09:13:08 
Started by orangepascal - Last post by princec
Hmm I think it could do with more success on Steam.

Cas Smiley

 9 
 on: 2017-12-14 08:28:03 
Started by orangepascal - Last post by orangepascal
Sweet... seeing a success like you've done more than once gives hope that if you keep at it success can come.


and yet it remains scary as shit with every new release to see if there is any "success".

 10 
 on: 2017-12-14 03:39:04 
Started by cygnus - Last post by fitz8
Good job. Really looking forward to further parts

Pages: [1] 2 3 ... 10
 
Ecumene (149 views)
2017-09-30 02:57:34

theagentd (214 views)
2017-09-26 18:23:31

cybrmynd (300 views)
2017-08-02 12:28:51

cybrmynd (287 views)
2017-08-02 12:19:43

cybrmynd (295 views)
2017-08-02 12:18:09

Sralse (291 views)
2017-07-25 17:13:48

Archive (968 views)
2017-04-27 17:45:51

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

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

theagentd (1427 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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
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!