Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (558)
Games in Android Showcase (150)
games submitted by our members
Games in WIP (602)
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] 2 3 ... 73
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-06 00:49:23
Space Ship Hygiene Simulator 2057
Smiley

What happens if two guys try to occupy the same bath tube?  Shocked
2  Discussions / General Discussions / Re: jgo on mobile on: 2015-02-23 17:54:02
Any chance for jgo to have the text reflow on mobile? If I zoom so I can read the rest, I have to scroll back and forth every sentence.
+1 from me.  Same resolution.
3  Discussions / Miscellaneous Topics / Re: Netbeans DataObject reference in other DataObject on: 2015-02-22 16:42:24
You'll probably need to anyway if you want to do more with Netbeans RCP.  Cool
4  Game Development / Newbie & Debugging Questions / Re: I'm trying to make a shotgun and this is happening on: 2015-02-22 16:29:58
Has been asked before: http://www.java-gaming.org/topics/bullet-shooting-in-mouse-direction/34029/view.html
Just use vectors right and don't use degrees...

Edit: was a bit quick with my response and missing the point... yeah show more code and mockup the result you want to have in an image editing program. Looking at the provided image, it seems like the angle is reapplied to the bullet each frame!?
5  Discussions / Miscellaneous Topics / Re: Netbeans DataObject reference in other DataObject on: 2015-02-22 16:23:18
Probably better post here: http://forums.netbeans.org/platform-users.html
6  Game Development / Newbie & Debugging Questions / Re: LibGDX Tilemap Null Tiles on: 2015-02-20 20:35:15
1  
map.getLayers().get(1) 

Off-By-One?  Are you sure you don't want get(0) ?
7  Game Development / Newbie & Debugging Questions / Re: Realtime 3D Terrain Splat Mapping on: 2015-02-19 17:53:18
Anything wrong with projecting to the FBO?  Sounds reasonable...
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-17 06:56:04
Parallax scrolling is the <marquee> of 2012-2015 Wink
Meh. I think it looks great!
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-16 23:20:28
Added triplanar texture coordinates generation to my texture "synthesis" shader:


10  Discussions / General Discussions / Re: What's your day job? on: 2015-02-16 15:45:13
In my free time, I work on LWJGL and (try to) raise a little girl.
Good luck! Mine is 4 and I (nearly) gave up on raising and moved on to survive Wink
11  Game Development / Game Mechanics / Re: Ideas for calculating when to generate new tiles. on: 2015-02-15 23:11:54
Usually you split the current region into quadrants and always have the 3 other regions generated/preloaded that connect to that quadrant:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
+---------+---------+---------+
|         |         |         |
|    A    |   A/D   |    D    |
|         |         |         |
+---------+----+----+---------+
|         | A *| D  |         |
|   A/B   +----+----+   D/C   |
|         | B  | C  |         |
+---------+----+----+---------+
|         |         |         |
|    B    |   B/C   |    C    |
|         |         |         |
+---------+---------+---------+

So here the middle of this 9 cells is your current region and the player (the *) is in quadrant A of it, so you need to generate the 3 top-left regions to allow seemless transition.
12  Discussions / General Discussions / Re: What's your day job? on: 2015-02-15 22:57:49
Freelance everything working mostly for insurance companies. Currently something between dev-op, cloud-manager, systems-engineer and portal-troublemakershooter...
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-14 08:26:40
Hey @cylab, I tried out your plugin (...)
I have to clarify that it is not my plugin,  I just forked the existing one and fixed some stuff.
14  Discussions / General Discussions / Re: Do you sometimes skip braces? on: 2015-02-13 23:27:47
I do python lately because we move our IT automation over to ansible and didn't like it at first. But after needing to write some of the automation stuff in java with heavy json modification, I was bewildered how awful it felt compared to the ease it was with python.

Regarding tabs and spaces. Just make sure you follow PEP 8 style guide for python and switch you IDE to show whitespaces (which is default for me anyways)
15  Game Development / Newbie & Debugging Questions / Re: WorkerThread, how to pass an undefined method to be executed..? on: 2015-02-13 23:15:43
Actually I was refering to the program organization when writing my post, since the problem with offloading arbitrary stuff to an external thread is that you have to manage what to do with the result, etc. somehow. This is difficult, if the isDone() polling and get()-result handling is in the gameloop, while the executor call is somewhere completely else. So having the callback, ensures that you don't have to put your code all over the place.

But yes, I should not have divagated to Guava, so here is an implementation without it:
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  
  // this rolls the callable and the callback in one interface
  public interface CallbackCallable<T> extends Callable<T>
  {
    // while the call() from callable should be called on the thread of the thread-pool
   
    // the following two should run on the gl thread
    void onSuccess(T result);
    void onFailure(Throwable thrown);
  }

  // ...

  // to get over the result from the future to the gl thread, a bridge is needed
  public class GLThreadBridge
  {
    // this connects the Future with the Callable that created it.
    private static class CallbackHolder<T>
    {
      Future<T> future;
      CallbackCallable<T> callback;

      public CallbackHolder(Future<T> future, CallbackCallable<T> callback)
      {
        this.future = future;
        this.callback = callback;
      }
    }

    // the pool
    private final ExecutorService pool = Executors.newFixedThreadPool(7);
    // and the callback queue
    private final ConcurrentLinkedQueue<CallbackHolder> holders = new ConcurrentLinkedQueue<CallbackHolder>();

    // to submit the tasks
    public <T> void submit(CallbackCallable<T> task)
    {
      holders.add(new CallbackHolder<T>(pool.submit(task), task));
    }

    // this handles the future polling and result callback calls
    public void handleFinished()
    {
      for (Iterator<CallbackHolder> iterator = holders.iterator(); iterator.hasNext(); )
      {
        CallbackHolder holder = iterator.next();
        try
        {
          if(holder.future.isCancelled())
            throw new InterruptedException("Task was cancelled");

          if(holder.future.isDone())
          {
            holder.callback.onSuccess(holder.future.get());
            iterator.remove();
          }
        }
        catch (Throwable t)
        {
          iterator.remove();
          holder.callback.onFailure(t);
        }
      }
    }
  }


Now you can use the bridge to submit callables with integrated callbacks:
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  
  // put this somewhere, you can access it
  GLThreadBridge glThreadBridge=new GLThreadBridge();

  // ...

  // this is an example how to use the submit method...
  void offloadToPool()
  {
    glThreadBridge.submit(
      new CallbackCallable<Chunk>()
      {

        // will be called on external thread
        @Override
        public Chunk call() throws Exception {
          return loadChunk();
        }

        // will be called from gameloop
        @Override
        public void onSuccess(Chunk loaded) {
          // do something with loaded
        }

        // will be called from gameloop
        @Override
        public void onFailure(Throwable thrown) {
          // handle a failure somehow
        }
      }
    );
  }


To move execution of the onSuccess()/onFailure() methods to the gameloop/gl-thread, handleFinished() has to be called at the beginning of the loop:
1  
2  
3  
4  
5  
6  
7  
8  
9  
  // and this shows how to integrate it in the gameloop...
  void gameLoop()
  {
    while(true)
    {
      glThreadBridge.handleFinished();
      //...
    }
  }


Disclaimer: I just wrote it down and didn't try it, so it might need more work to actually... well... work Wink
16  Game Development / Newbie & Debugging Questions / Re: WorkerThread, how to pass an undefined method to be executed..? on: 2015-02-13 22:22:08
This is solved by Future.
Well, read my post?
17  Game Development / Newbie & Debugging Questions / Re: WorkerThread, how to pass an undefined method to be executed..? on: 2015-02-13 22:14:51
Actually the biggest problem is usually not the thread execution, but getting the result back to the GL thread: With google guava, you would probably do something like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
ListeningExecutorService pool = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10));
Futures.addCallback(
   pool.submit(new Callable<Chunk>() {
      public Chunk call() {
         return loadChunk();
      }
   },
   new FutureCallback<Chunk>() {
      public void onSuccess(Chunk loaded) {
         // do something with loaded
      }
      public void onFailure(Throwable thrown) {
         // handle a failure somehow
      }
   },
   myGameloopExecutor // execute the callbacks on the gameloop
);


You would need to implement your own GameloopExecutor by minimally implement the AbstractExecutorService class and store the Runnables and Callables you get in a Queue that you could execute at the start of the gameloop.
18  Discussions / General Discussions / Re: Do you sometimes skip braces? on: 2015-02-13 21:54:45
Where does that else clause even set in? It's he lower if, isn't it?

Yep it's really
1  
2  
3  
4  
5  
6  
7  
8  
9  
if(nested()) {
   if(stillNesting()) {
      for(int count =  0; count < nestAmount; count++)
         for(int dex =  0; dex < nestAmount * 2; dex++)
            initMindExplosion(fetalPosition);
   } else {
      whenWillIdoIt();  
   }
}

19  Game Development / Newbie & Debugging Questions / Re: WorkerThread, how to pass an undefined method to be executed..? on: 2015-02-13 21:35:13
Also refrain from misusing reflected methods. Just let the user pass in a runnable...
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-13 21:27:45
Fixed some stuff in the GLSL-plugin for Intellij Idea

It now also works correctly with IDE themes, like e.g. Dracula:
21  Discussions / General Discussions / Re: Do you sometimes skip braces? on: 2015-02-13 21:05:35
1  
2  
3  
4  
5  
6  
//This makes my brain go numb.
if(nested())
   if(stillNesting())
      for(int count =  0; count < nestAmount; count++)
         for(int dex =  0; dex < nestAmount * 2; dex++)
            initMindExplosion(fetalPosition);


hehe, I do exactly this, but the following is super evil:
1  
2  
3  
4  
5  
6  
7  
8  
// Some guess-work here ...
if(nested())
   if(stillNesting())
      for(int count =  0; count < nestAmount; count++)
         for(int dex =  0; dex < nestAmount * 2; dex++)
            initMindExplosion(fetalPosition);
else
   whenWillIdoIt();  

22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-13 20:36:39
Quote
Estimated balance at 2017-02-13:    $239
Wow, you'll be rich!
23  Games Center / Showcase / Re: Spinner Tronic -- an unique arcade experience! on: 2015-02-13 20:34:42
The second track is MUUUUUUCH better (imho) Pointing

Other feedback pending...
24  Games Center / Showcase / Re: Spinner Tronic -- an unique arcade experience! on: 2015-02-13 17:29:04
Might be cool,  but after the trailer, I've still no idea whats this about and how to play.  Also for my personal taste, the music completely turned me off...
25  Discussions / General Discussions / Re: Do you sometimes skip braces? on: 2015-02-08 08:44:20
I skip braces for loops and conditions, but I am not doing it, if there is an else block. Also I don't do single line ifs and fors anymore,  because it got in the way when placing breakpoints during debugging.
26  Games Center / WIP games, tools & toy projects / Re: The Minecraft RPG on: 2015-02-07 01:20:49
so... The RPG ...then Wink
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-04 21:23:36
Today I made a video of the Texture Synthesis Shader I did 3 days ago Wink
<a href="http://www.youtube.com/v/iQllSZyT6TU?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/iQllSZyT6TU?version=3&amp;hl=en_US&amp;start=</a>
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-04 18:30:14
Replaced the LWJGL vecmath packages with libgdx ones in SPGL (my "framework"). Discovered libgdx vecmath is not threadsafe and everything broke. Grr.

Cas Smiley
29  Games Center / Showcase / Re: Radius on: 2015-02-03 08:35:20
I say give him a month , otherwise BANG and the dirt is gone.
So what exactly is the problem again with a java game being posted in a java gaming showcase section Huh
Also why do you put someone elses work down as dirt  Huh
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-01 01:38:37
I set up my new desk and cleaned things up. I'm loving the look.



made a notebook stand Wink

Pages: [1] 2 3 ... 73
 
Pippogeek (17 views)
2015-03-05 14:36:23

Pippogeek (14 views)
2015-03-05 13:56:12

Pippogeek (12 views)
2015-03-05 13:55:41

Pippogeek (14 views)
2015-03-05 13:23:02

Pippogeek (14 views)
2015-03-05 13:15:28

Pippogeek (10 views)
2015-03-05 13:15:04

Pippogeek (17 views)
2015-03-05 13:13:24

Pippogeek (21 views)
2015-03-05 13:11:33

BurntPizza (46 views)
2015-02-27 06:09:35

BurntPizza (35 views)
2015-02-27 05:56:17
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!