Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
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 ... 54
1  Discussions / General Discussions / Re: Color in an ASCII game? on: 2014-11-26 23:18:30
It's good as long as it's done well. (read: palette(s))
2  Games Center / Contests / Re: Ludum Dare 31 on: 2014-11-26 22:14:55
Just in time for finals week  Emo
3  Discussions / Chitchat Monster / Re: PrepperCraft! - A free voxel game. on: 2014-11-26 21:43:39
Have you even listened to what anyone has said!? Its not wip, It shouldn't even be considered a game. Its just a freaking Jframe!

I think we can also stop repeating ourselves.
4  Games Center / WIP games, tools & toy projects / Re: Paint.JAVA - Attempt at cloning Paint.NET (with cross-platform support) on: 2014-11-26 19:53:08
That Color chooser looks beautiful, really nicely done!

Thanks! I did the components, Heroes tweaked and added the More, Less and Settings buttons + collapsible layout stuff.
It's so far my main visible contribution to the project, the rest has been mostly been going into reworking the program architecture.
5  Game Development / Newbie & Debugging Questions / Re: does return return the actual object or a copy of the object? on: 2014-11-26 19:25:14
So if you want to have lots of booleans but not waste memory, use a BitSet.

Quote
if it's sure its reference won't escape/survive its local scope boundary!

Note that this is more involved than one might expect, and in my experience happens infrequently.

I wanna know is there anyway that I can edit the original variable with another variable in the same way that c++ does it or should I just build setting methods.

Note that you can store fields in some kind of Reference type (even something as simple as a 1-element array) to (crudely) simulate this functionality.
The provided atomic impl is actually pretty useful at times: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicReference.html
6  Games Center / WIP games, tools & toy projects / Re: Paint.JAVA - Attempt at cloning Paint.NET (with cross-platform support) on: 2014-11-26 18:31:53
Both of those issues got fixed quite a while ago, a lot has changed since February:



Heroes is planning to have an actual release SoonTM, I assume that's why the topic has been re-opened.
Just a little teaser  Wink
7  Discussions / Miscellaneous Topics / Re: C#, did Microsoft just want to be different? on: 2014-11-24 20:17:42
I'm pretty sure all those names are common conventions elsewhere, the universe didn't begin with Java.

Dictionary is pretty common (although I do prefer Map for it's mathematical connotation), one could argue that addRange is more accurate and clear as to what it means than addAll, given that the parameter is not (I don't think) necessarily all of the elements of a collection.
I did think "Solution" was a bit gimmicky, but it still makes sense at least.
8  Discussions / General Discussions / Re: LWJGL or Unity, UDK, Cryengine on: 2014-11-23 19:18:19
@Cas

This thread isn't really the place for it, but at some point I would like to hear your opinions on how/where C# is less thought out than Java, as in my experience the general consensus is the opposite. And now that the .NET core is being open sourced, C# is looking better than ever, so I'm curious as to what "the catch" might be.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-22 03:47:59
"Method references" are in Java 8 too:

1  
Stream.of(1,2,3,4).map(Integer::bitCount).forEach(System.out::println);


(even works for this::someMethod!)
10  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:41:32
Pro tip: most editors have this functionality. (although things like word processors probably don't often include regex ability...)
11  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:39:09
Find: * enter number of spaces for each tab *
Replace: * tab *

Un-check regular expressions. Click.
12  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:37:12
/\*.*?\*/ From the SO post seems to remove the line nums just fine on regexpal, but you'll have to remove the description(s) at the bottom yourself.

Just Ctrl-F in the editor, put /\*.*?\*/ in the Find field, leave 'Replace with' blank (to replace the comments with nothing, effectively removing them), check 'Regular Expressions', and then click 'Replace All.'
13  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:30:34
What do the comments look like?

Also: http://regexpal.com/ is great for figuring these out.
14  Game Development / Newbie & Debugging Questions / Re: Saving only one value in preferences file - libgdx on: 2014-11-21 02:29:07
Just don't change the options you don't want updated when you flush().
15  Discussions / Miscellaneous Topics / Re: Remove all comments Eclipse shortcut on: 2014-11-21 02:23:35
Use eclipse's Find/Replace (google that if you don't know)

In fact, here is the regex for this exact situation it appears: http://stackoverflow.com/questions/10530055/eclipse-find-replace-with-regex-to-comment-lines?lq=1
16  Discussions / General Discussions / Re: Jar Decompiler? on: 2014-11-20 23:48:03
Chances are, rebuilding an old project from scratch would increase code quality.

As for decompilers, here are some: http://stackoverflow.com/a/272550
(note: the SO question is 6 years old, check recency of answers)
17  Discussions / General Discussions / Re: General Java Questions on: 2014-11-20 04:27:40
Google. Wikipedia. You will find better answers faster.

Here's a sample of uses:
http://www.informit.com/library/content.aspx?b=STY_XML_21days&seqNum=15
http://webdesign.about.com/od/xml/a/aa060401a.htm

Why such an interest in XML?
18  Discussions / General Discussions / Re: [Resolved] java jar file rejected by folks at "Demo Derby", need .mov ASAP on: 2014-11-19 21:32:46
Fraps + WinFF for encoding has been my combo for a while, but I'm thinking I'll try OBS next time I need to do video stuff.
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-18 22:31:11
Added MORE multithreading to Verbal. There is no programming problem that cannot be solved by an extra layer of indirection, and an extra thread!

Still trying to find the transformation that makes my seam carving cost function scale linearly with threads, instead of what it is currently doing: slowing down quadratically. Damn false sharing...  Emo
The energy function gets a nice 3.5x speedup though.  Smiley
20  Discussions / General Discussions / Re: Programmer jokes on: 2014-11-18 21:11:50
Not really a joke, but this is valid code:

1  
2  
3  
4  
// the face of disapproval
public static void ಠ_ಠ(String s) {
    throw new Error(s);
}


Useful for all your exception handling needs!


http://kutruff.wordpress.com/2011/02/08/using-%E0%B2%A0_%E0%B2%A0-to-throw-exceptions/
21  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:37:50
Might as well go ahead and write an embedded scripting language for all your dynamic variable setting needs!
It's, uh.. webscale!
22  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:33:36
So you want to prematurely complicate things?  Wink
23  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:28:58
Why? (for both of those last sentences)
24  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-17 04:25:52
* plugs Clojure for it's small size (read: easy to pick up), elegance, and it's lispy brain-expanding powers... *  Pointing
25  Game Development / Newbie & Debugging Questions / Re: How does this work? on: 2014-11-17 04:20:26
This code is simply "measuring" (if you can call it that) the JIT warmup time.
By the time the code is optimized the first loop is probably almost done.
Also have to look out for that fact that it can often be smart enough to see that the loops accomplish nothing, and remove them entirely.

If you want any kind of meaningful data out of a Java microbenchmark you're pretty much going to have to use JMH.
http://openjdk.java.net/projects/code-tools/jmh/
http://java-performance.info/jmh/

Do you have any opinion on using this KeyValue class for things like storing Entity X/Y which would be constantly read/written to? I imagine it would be more optimized in that case if I were to encapsulate the x/y coordinates in an Object like a Point or something as well.

HashMaps are pretty bad for cache locality, good ol' ArrayList has your back 99% of the time. And you know what they say about premature optimization. Have you attempted to time ArrayList<Point> etc. vs. Map? I'll bet List is faster.
It's also almost guaranteed that you don't need every last drop of perf anyway. Don't think too hard about it until you need to.
26  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 06:20:58
I may misunderstand something, but isn't using a rawtype not a good idea? I know mine is far from the best idea, but at least there isn't any possibility of contaminating the list, such as putting a string in a boolean list.

CopyableCougar4

One should always prefer the genric of course, but in this case (arrays) it's not possible, and in fact you loose no type saftey with a raw type: (because the declaration isn't raw, only the initializer)

1  
2  
3  
4  
5  
@SuppressWarnings("unchecked")
List<Boolean>[][] lists = new ArrayList[2][2];

lists[0][1] = new ArrayList<>();
lists[0][1].add(5); // Compiler error; just like you would expect
27  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 04:50:47
Ah, sorry, didn't see it.
28  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 04:41:19
To circumvent the issue without changing the rest of the code, use a rawtype:

1  
grid = new ArrayList[cols][rows];


instead of grid = new ArrayList<Entity>[cols][rows];

The declaration can stay as it is.
29  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-16 00:09:35
In the same way the memory address 0 isn't at 0 but it is at 0 on the assigned memory group...

Pretty much, the more concise way to think about it is as an offset:

1  
2  
3  
4  
// array is located at some address, but we don't care,
// we use addresses relative to the offset of the array:
int[] array = new int[10];
int a = array[4]; // we fetched the data at {array offset} + {sizeOf int} * 4


Individual variable offsets are also relative to the offset of the program they are contained in, which is in turn contained in the "virtual address space" created by the OS.
It's offsets all the way down...
30  Game Development / Newbie & Debugging Questions / Re: ANDROID Perlin Noise clouds & CPU-Usage & Bitmaps on: 2014-11-15 05:58:16
Ah, I believe I mixed up what the desired effect was... (I still suggest the lens)

Both combined would definitely look good. If the 3D is too slow (probably won't be if you don't compute too many layers of z), then you could fake it by thresholding the 2D noise.
Pages: [1] 2 3 ... 54
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (57 views)
2014-11-26 15:22:04

toopeicgaming1999 (50 views)
2014-11-26 15:20:36

toopeicgaming1999 (10 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (26 views)
2014-11-25 11:26:43

Gibbo3771 (24 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (75 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50
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

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