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 ... 291
1  Discussions / General Discussions / Re: How do I request my game to be featured? on: 2015-03-06 10:28:55
It's an uncoordinated, rather arbitrary process, highly prone to bribery. $_$

As I cannot read each and every post (mommy knows I try...), a PM is the most effective way to bring your game under the attention of those in control of said process.
2  Discussions / General Discussions / Re: The Khronos Group announces "Vulkan": the successor to OpenGL on: 2015-03-04 14:36:42
isn't it 3.5 ? .. wouldn't call intels opengl-driver a real driver.
Wouldn't it be 2.5 then? persecutioncomplex


* Riven heads for the hills.
3  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-03 18:18:48
Nuff of this. We all have our ill-informed moments. No need to 'gang up' on our beloved Keith. I'm sure lots of people found new information in this thread about the inner workings of Swing - we should focus on sharing such information instead of telling eachother how ill-informed we are, over and over and over. We don't need N similar corrections from N people quoting the same statement. It gets old rather quickly.

I'm not saying this as a moderator - just as a slightly annoyed innocent bystander.
4  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-02 21:37:24
Modal dialogs do not cause a new Thread to spawn. They create a new Event Queue and Event pump, right on top of the current queue/pump. Think of it as recursion. A stack of queues and pumps, where only the top of the stack is active.

When you have an uncaught exception reaching an event pump callsite, however, a new EDT will be spawned, as the active EDT is considered in a state not worthy to recover.
5  Java Game APIs & Engines / OpenGL Development / Re: libgdx/lwjgl jerkiness rendering meshes / texture regions on: 2015-03-02 20:00:27
Generate mipmaps and configure the texture filters to use said mipmaps Smiley
6  Java Game APIs & Engines / OpenGL Development / Re: Using Slick2D's Image.getGraphics crashes on some machines on: 2015-03-02 19:26:04
It's a native crash Pointing There won't be an Exception.



Anyway, as you are creating an image every frame, you might run out of vRAM, making the texture allocation fail, after which Slick2D might be sending/reading its pixels to/from a null pointer.
7  Games Center / nK Game Competition - 2015 / Re: Java4K Sourcecode Compressor Community Effort (JSCCE) on: 2015-02-27 20:53:28
I was swamped today, will be swamped the entire weekend and then will encounter some light swamping. I will join the party immediately afterwards.
8  Discussions / Miscellaneous Topics / Re: Yay, free games! Zero's Game Giveaway on: 2015-02-27 12:05:33
why the f**k would i sell it on g2a when i say i want it -.-
Ah, always pleasant to have you around. The padded room is on your left.
9  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-27 01:43:55
1  
2  
3  
s = s.replaceAll("(\\G|([\\+|\\-]))\\s+(\\1)", "[$2,$3]");
s = s.replaceAll("\\s*([\\+\\-\\*/%,\\.\\(\\)\\{\\}\\[\\]=;:<>!&\\|\\^])\\s*", "$1");
s = s.replaceAll("\\[\\,\\]", "").replaceAll("\\[([\\+|\\-]?)\\,(\\1?)\\]", "$1 $2");

Input: -
abc ++ + 6 + ++ xyz -- - 7 - -- pqr -- + x ++ - 4

Output:-
abc++ +6+ ++xyz-- -7- --pqr--+x++-4


Minifier: http://pastebin.java-gaming.org/a3efe60272d19 persecutioncomplex
Minified minifier: http://pastebin.java-gaming.org/3efe0772d2910 (with free linefeeds @ column ~80)



Update 1
Input: -
abc ++ + ++ xyz -- - 7 - -- pqr -- + x ++ - 4

Output:-
abc++ +++xyz-- -7- --pqr--+x++-4
Emo
Required:
abc+++ ++xyz-- -7- --pqr--+x++-4
Emo

Fix 1
1  
2  
3  
4  
5  
s = new StringBuilder(s).reverse().toString();
s = s.replaceAll("(\\G|([\\+|\\-]))\\s+(\\1)", "[$2,$3]");
s = s.replaceAll("\\s*([\\+\\-\\*/%,\\.\\(\\)\\{\\}\\[\\]=;:<>!&\\|\\^])\\s*", "$1");
s = s.replaceAll("\\[\\,\\]", "").replaceAll("\\[([\\+|\\-]?)\\,(\\1?)\\]", "$1 $2");
s = new StringBuilder(s).reverse().toString();

Input: -
abc ++ + ++ xyz -- - 7 - -- pqr -- + x ++ - 4

Output:-
abc+++ ++xyz-- -7- --pqr--+x++-4
Grin

http://pastebin.java-gaming.org/efe078d292016 (hey it's 3:30AM, gimme a break!)



Update 2
Input: -
def -- - 5 - -- xyz

Output:-
def-- -5- --xyz
Emo
Optimal:-
def---5- --xyz
Emo

Fix 2
1  
2  
3  
4  
5  
6  
s = new StringBuilder(s).reverse().toString();
s = s.replaceAll("(\\G|([\\+|\\-]))\\s+(\\1)", "[$2,$3]");
s = s.replaceAll("\\s*([\\+\\-\\*/%,\\.\\(\\)\\{\\}\\[\\]=;:<>!&\\|\\^])\\s*", "$1");
s = s.replaceAll("\\[\\,\\]", "").replaceAll("\\[([\\+|\\-]?)\\,(\\1?)\\]", "$1 $2");
s = new StringBuilder(s).reverse().toString();
s = s.replaceAll("(\\w([\\+\\-])\\2) (\\2\\w)", "$1$3");


Somebody will one day be extremely happy with this optimization Stare
10  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-27 01:05:11
No worries, I'll just split it off, tomorrow Smiley
11  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-27 00:55:22
It's relatively easy to put them through a stress-test. You simply minify the minifier, and see whether it produces a working version of itself again... The version I posted can't do it, fixing it now. (actually, going to bed...)
12  Games Center / WIP games, tools & toy projects / Re: Flight, Mobility Emphasis Platformer WIP on: 2015-02-26 23:56:28
Nobody can see your dropbox images.
13  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 23:43:10
Where would/will we draw the line? LWJGL? LibGDX? Any library?

Besides, if you're familiar with LWJGL, and willing to enter a sourcecode restricted contest with LWJGL, then Java2D is peanuts.
14  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 23:37:42
After about an hour, I reached 890 too, without placeholders, just tokens Smiley

Here is my horrific state-machine / tokenizer:
http://pastebin.java-gaming.org/ebea33e2f2e10
(ironic how my PHP parser b0rks)
15  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 21:42:13
Numbered or cryptographically hashed, whichever utility code is around Pointing
16  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 21:37:37
It's not that hard actually. You only need a parser capable of finding two kinds of comments, string literals and char literals, using a simple state machine. You replace these ranges by placeholders, apply whatever transformation that would corrupt what you replaced, and then inject the literals back in. I just didn't feel like actually doing it... persecutioncomplex

So much to do, so little time.
17  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 17:30:51
Cas: 'auto refactoring' is left as an exercise for the reader. Pointing



src → [javac → proguard → decompiler] → src → strip whitespace → persecutioncomplex → win!
18  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 17:21:58
Abuse: I don't care really Smiley If people want to be jerks, then so be it. Cranky

Similarly, nothing prevents a contestant from fetching a JAR from the web, and attaching it to the ClassLoader. It's against the spirit and the rules of the competition. If anyone wants to 'win' like that, hoping to get away with it, then I feel sorry for the bastard.
19  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP on: 2015-02-26 15:12:48
Threads in the correct board(s) will automatically have the required forms to manage your contest-entry. Just copy/paste your source, upload your assets and press 'publish', and it will... happen. Visitors will see the *.jar and/or signed applet in the opening post.
20  Games Center / nK Game Competition - 2015 / Java4K Sourcecode Compressor Community Effort (JSCCE) on: 2015-02-26 14:49:26
Here is a first lousy attempt at it kicking off the effort to create a community sourcecode compressor for Java Pointing

LousySourcecodeCompressor.java

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  
import java.io.*;
import java.util.regex.*;

public class LousySourcecodeCompressor {
   public static void main(String[] args) throws Exception {
      File file = new File(args[0]);

      int origLength = 0;
      StringBuilder trimmed = new StringBuilder();
      BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
      while (true) {
         String line = br.readLine();
         if (line == null)
            break; // reached end of file

         origLength += line.length() + 1; // +1 for line-break
         line = line.trim(); // strip optional whitespace
         if (line.isEmpty())
            continue; // strip empty lines

         trimmed.append(line).append('\n');
      }
      String code = trimmed.toString();

      // make a lousy attempt at stripping comments
      code = Pattern.compile("//[a-zA-Z\\s]+$", Pattern.MULTILINE).matcher(code).replaceAll("");

      // make a lousy attempt at stripping annotations
      code = Pattern.compile("^@[a-zA-Z]+$", Pattern.MULTILINE).matcher(code).replaceAll("");

      // make a lousy attempt at stripping optional whitespace
      code = code.replaceAll("\\s*([\\+\\-\\*/%,\\(\\)\\{\\}\\[\\]=;:<>!])\\s*", "$1");

      System.out.println(code.length() + "/" + origLength);
      System.out.println();
      System.out.println(code);
   }
}

which takes OddEntry.java and produces the following (N.B.: newlines inserted by me)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
853/1189

package net.indiespot.java4k.entries;import java.awt.*;import net.indiespot.java4k.Java4kRev1;public
class OddEntry extends Java4kRev1{public OddEntry(){name="Odd Entry";}public void render(Graphics2D
g){g.setColor(new Color(128,64,128));g.drawString("Drag the mouse a little...",8,20);g.setColor(new
Color(0,64,128));int b,r,a,c,q,t;for(r=150;r>=30;r-=15){t=((elapsed()+130_000)/((200-r)/25));b=r/3;
a=(w-r)/2;c=(h-r)/2;q=(int)(t%(r+b));g.drawLine(a+Math.max(0,q-b),c,a+Math.min(r,q),c);
q=(r+b)-(int)((t+r)%(r+b));g.drawLine(a,c+Math.max(0,q-b),a,c+Math.min(r,q));
q=(r+b)-(int)((t+r-b)%(r+b));g.drawLine(a+Math.max(0,q-b),c+r,a+Math.min(r,q),c+r);
q=(int)((t-r)%(r+b));g.drawLine(a+r,c+Math.max(0,q-b),a+r,c+Math.min(r,q));}if(mouse.dragArea
!=null){g.setColor(new Color(128,64,128));Rectangle w=mouse.dragArea;g.drawRect(w.x,w.y,w.width,w.height);}}}

Note that it does not yet respect string literals, which makes it borderline useless Smiley
21  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP on: 2015-02-26 14:49:18
A slightly more elaborate entry

OddEntry.java
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  
import java.awt.*;
import net.indiespot.java4k.Java4kRev1;

public class OddEntry extends Java4kRev1 {
   @Override
   public void render(Graphics2D g) {
      // print instructions
      g.setColor(new Color(128, 64, 128));
      g.drawString("Drag the mouse a little...", 8, 20);

      // draw something mesmerizing for average Joe
      g.setColor(new Color(0, 64, 128));
      int b, r, a, c, q, t;
      for (r = 150; r >= 30; r -= 15) {
         t = ((elapsed() + 130_000) / ((200 - r) / 25));
         b = r / 3;
         a = (w - r) / 2;
         c = (h - r) / 2;

         q = (int) (t % (r + b));
         g.drawLine(a + Math.max(0, q - b), c, a + Math.min(r, q), c);

         q = (r + b) - (int) ((t + r) % (r + b));
         g.drawLine(a, c + Math.max(0, q - b), a, c + Math.min(r, q));

         q = (r + b) - (int) ((t + r - b) % (r + b));
         g.drawLine(a + Math.max(0, q - b), c + r, a + Math.min(r, q), c + r);

         q = (int) ((t - r) % (r + b));
         g.drawLine(a + r, c + Math.max(0, q - b), a + r, c + Math.min(r, q));
      }

      if (mouse.dragArea != null) { // 'mouse.dragArea' provided by superclass
         g.setColor(new Color(128, 64, 128));
         Rectangle w = mouse.dragArea;
         g.drawRect(w.x, w.y, w.width, w.height);
      }
   }
}


Result (please note the erratic framerate is caused by the GIF, not the game-loop)
Click to Play
22  Games Center / nK Game Competition - 2015 / Java4K framework WIP / discussion on: 2015-02-26 14:49:07
In an effort to breath life back into Java4K, I'm testing the waters with a Java4K platform. I'm sharing this WIP early, and plan to have a ton of revisions, based on your feedback, and/or my gut feeling.

My plan for Java4K is to lower the barrier to entry that haunted the last few years of Java4K. The toolchain required to build a tiny *.jar.pack200.gz was daunting, even for experienced members of the community. A newby would find that his bare bones main-loop would consume ~2500/4096 bytes, while those in possession of said toolchains could fit over 30KB of sourcecode in their 4KB binary. Suffice to say that this played at least some role in the Java4K contest participation rate dropping over the years.

To lower the barrier to entry, we have to make some radical changes to how the contest is setup - to the point where 'Java4K' may be a bit of a misnomer. Instead of focusing on binary size, we will focus on sourcecode size to which asset-sizes will be added. Entries (source + assets) will be limited to, say, 16K of sourcecode, which previously would have yielded a ~4K compressed binary for somebody with a reasonably advanced toolchain.
The result will be compiled & packed (serverside on JGO) in a JAR of which the final size plays no role. Both newbies and experts will likely find such a limit challenging enough to write a decent game with enough features, while still being restricted enough to 'get it done', reducing chances of feature creep.

To lower the barrier to entry even further, I will provide a game-loop, and people simply have to implement render() and/or update(), where a minimalistic valid contest-entry would be like:

MinimalisticEntry.java
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
-public class MinimalisticEntry extends Java4kRev1 // which extends javax.swing.JPanel
+public class MinimalisticEntry extends Java4kRev2 // which extends java.awt.Canvas
{
   int x;

   // called 60x per second
   public void update() { // move across screen at constant rate, regardless of framerate
      if(++x >= w) x = 0; // 'w' & 'h' provided by superclass
   }

   // called at most 60x per second
   public void render(Graphics2D g) {
      g.setColor(Color.YELLOW);
      g.drawRect(x, mouse.y, 64, 64); // 'mouse' provided by superclass
   }
}


Java4kRev#.java
(superclass of your entries)
Rev 2http://pastebin.java-gaming.org/154eb0e2a231eBackend now uses active rendering
Rev 1http://pastebin.java-gaming.org/e71548e1b2e1aInitial dump



TODO:
  • Add Keyboard support (alongside current Mouse support)
  • Add active-rendering backend, as opposed to current EDT piggyback/hack
  • Add support for identifying mouse buttons
23  Games Center / Contests / Re: Java4K Competition 2015 on: 2015-02-24 21:01:24
I just finished reading all your replies on that thread. You sway back and forth between never abandoning it, and being openminded towards potential contributers. This is not a 'prior notice' of any kind, especially as you actually continued to host the next context. For a lot of us it came as an absolute surprise that one day before the latest contest was about to start, it was pulled.

There are severe problems with applets but that is not a reason to abandon the contest. Like mentioned in the thread you refered to, Ludum Dare isn't crippled by the demise of applets: overthere native binaries/executables are OK, get many downloads, high ratings, etc. What's wrong with Java4K going the JAR route, with optional launcher? Last time I checked Java4K was by JGO, for JGO, just like Ludum Dare is pretty self-contained: only the top 10, maybe 20, is appealing to the general public.

So... JGOers will cope with whatever deployment method we pick. Nobody cares about average Joe struggling to launch our games. We're trying to have a good time among ourselves here... trying to impress everybody by either our first released game ever, or clever hack.



Regarding nobody asking you to continue Java4K, nor anyone opting to take over... I could say the same about JGO. People tend to assume you continue unless you explicitly state you're about to pull the plug.
24  Discussions / Miscellaneous Topics / Re: Make the simplest code unreadable on: 2015-02-24 19:07:49
You confuse data for information, but enough of this derailing persecutioncomplex
25  Discussions / Miscellaneous Topics / Re: Make the simplest code unreadable on: 2015-02-24 18:54:01
I bet only a *.raw image-file can start with 0xCAFEBABE
26  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-24 18:47:36
I can break into your home or your server for you, whichever you prefer, but you have to choose.
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-24 13:55:37
Does the FPS counter (or the callsite) create/modify textures to render the (ever changing) chars?
28  Discussions / Miscellaneous Topics / Re: Make the simplest code unreadable on: 2015-02-24 13:51:19
Enhanced FizzBuzz for dummies:
1  
2  
3  
4  
5  
   for (int i=1;i<=100;i++) {
      int a=((528>>i%15-1)&1)*4;
      int b=((-2128340926>>(i%15)*2)&3)*4;
      System.out.println("FizzBuzz".substring(a,b)+(a==b?i:""));
   }
29  Discussions / Miscellaneous Topics / Re: Make the simplest code unreadable on: 2015-02-24 13:30:16
This shit compiles and runs.
1  
\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0063\u006c\u0061\u0073\u0073\u0020\u004a\u0047\u004f\u0020\u007b\u0020\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0073\u0074\u0061\u0074\u0069\u0063\u0020\u0076\u006f\u0069\u0064\u0020\u006d\u0061\u0069\u006e\u0028\u0053\u0074\u0072\u0069\u006e\u0067\u005b\u005d\u0020\u0061\u0072\u0067\u0073\u0029\u0020\u007b\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074\u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0022\u004c\u0061\u006d\u0065\u0020\u003a\u006f\u0028\u0022\u0029\u003b\u0020\u007d\u0020\u007d


This is how I commit code to the evil corporations, to keep it safe from prying eyes. Pointing
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-24 13:03:21
This may sound blunt: but that's impossible. Your FPS calculator itself is most likely to blame. This is good news, as the problem is in your code, so you can fix it.
Pages: [1] 2 3 ... 291
 
Pippogeek (18 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 (24 views)
2015-03-05 13:11:33

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

BurntPizza (36 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!