Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (223)
games submitted by our members
Games in WIP (813)
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 / Game Mechanics / Re: 2D soft shadows on: 2016-02-20 14:02:49
The library box2dlights achieves this by rendering the light meshes into a framebuffer that's lower resolution than the screen resolution.
Then it blurs the framebuffer using gaussian blur and renders that to the screen.
For reference: https://github.com/libgdx/box2dlights
2  Discussions / General Discussions / Re: [libGDX] Photoshop-like filters on: 2016-02-18 16:42:16
Yeah, that's totally possible. Take a look at shaders.
A good starting point can be found here: https://github.com/mattdesl/lwjgl-basics/wiki/Shaders
For your examlpe you would have to render the whole scene into a Framebuffer (basicly a texture that you can write to).
Then you would render that to the screen using a shader that will make the parts of the image you want to be gray, gray.
3  Game Development / Networking & Multiplayer / [Kryonet] Udp not working when having the server on pc and the client on android on: 2015-02-28 18:45:06
Recently i have picked working on the multiplayer aspect of my game again.
I'm sending positional data of objects via UDP and other stuff that has to arrive 100% of the time like chat messages via TCP.
When testing on the desktop it worked fine ( PC1[Server] to PC1[Client] ). Also, when hosting on Android it worked fine( Android [Server] to PC1[Client] ).
Then i tested hosting the game on PC1 and having the android device connect to it. Now my problem is that none of the UDP messages the server(PC1) is sending to the Android device are arriving, while all TCP messages are. I tried switching the port from being different to being the same, but that didn't make a difference. I thought it might be an issue of my router, but when testing with another PC (PC1 server, PC2 client or PC2 server and PC1 client) the UDP messages were arriving as normal.

To sum it up this is what is happening:

TCP: Always : works
UDP: PC1      [Server] <-> PC2[Client] : works
UDP: Android [Server] <-> PC1[Client] : works
UDP: PC1      [Server] <-   Android[Client] : works
UDP: PC1      [Server]   -> Android[Client] : doesn't work

The connection is active the whole time and all the TCP packages are arriving, but i don't think that using TCP for real time positional data is a good thing.
I'm using
1  
server.sendToAllUDP(packet);

to send the UDP packets.

I'm thankfull for any help, i just can not seem to find a solution for this, and there isn't much information about it on the internet.
4  Game Development / Newbie & Debugging Questions / [LibGDX]Correct location to save and load levels on: 2014-11-05 04:09:31
Hello,
I am currently working on a 2D sidescroller. My levels are stored in zip files containing the level data and the texture data, so that a user created level is only 1 file and not a whole folder, that contains all level files.My levels are currently stored in the assets folder. It's working really when I define the absolute zip file path, but when using the libgdx filehandle, it gives this error:
1  
java.io.FileNotFoundException: maps\test.zip (System cannot find the specified path.)      <- translated, my eclipse is in German

The zipfile is constructed like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
        File file = Gdx.files.internal("maps/test.zip").file();
        ZipFile archive = null;
   try {
         archive = new ZipFile(file);
   } catch (ZipException e) {      
      e.printStackTrace();
   } catch (IOException e) {      
      e.printStackTrace();
        }


I think it is because the assets are in the apk/jar file and thereforce it can't load: "maps/test.zip", because it load's files relative to the apk.
So, my solution would be creating a levels folder next to the apk/jar and putting the levels into there.( Loading them wouldn't be a problem anymore then.)

  • My first question is: How can I put files there, because when I use the regular usb debugging, it only sends the apk contaning the assets folder and not some extenal folders.
  • My second question is: Do I have read and write acces to next to my apk?(I sure will need permissions on android for that)
  • My third question is: Can I load the standard levels out of the apk somehow and download the user created levels next to the apk/jar?
  • My fourth question is: Do you think this is a good way to handle levels, or how would you do it?

Sorry if I made some mistakes, English isn't my mother tongue.I will appreciate help a lot Smiley
-Quex
5  Java Game APIs & Engines / Engines, Libraries and Tools / LibGDX +Kryonet problem on: 2013-11-26 23:13:29
Im very new to Multiplayer programming and i know the basics of kryonet. I made a little Top down shooter but when i try to do something that kryonet activates in the MainGame the game crashes and it gives me the error:"No opengl context in current thread". I googled the problem and found out that it has something to do with Libgdx and kryo being on different Threads. I tried for an hour to figure out how to pass something from Kryonet to libgdx but everything doesnt work. My mainclass implements the runnable interface and has the method:
1  
2  
3  
4  
5  
   @Override
   public void run() {
       ((Game) Gdx.app.getApplicationListener()).setScreen(MainGame.JPlayScreen);
     
   }

and my Kryonet Customlistener has the method:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public void received(Connection c, Object o) {
     
      if(o instanceof Packet0LoginRequest) {
         Packet1LoginAnswer loginAnswer = new Packet1LoginAnswer();        
         loginAnswer.accepted = true;
         c.sendTCP(loginAnswer);      
         GameHolder.game.run();    //Gameholder class holds the gameclass
     
      }
     
   
}

But it still gives me the error:no opengl context found in current thread

I hope you can help me solve the problem Wink
-Quexten
Pages: [1]
 
cybrmynd (121 views)
2017-08-02 12:28:51

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

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

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

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

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

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

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

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

Rule (1270 views)
2017-03-19 12:42:17
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!