Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
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 ... 24
1  Game Development / Shared Code / Re: My entity properties... a bad idea? on: 2014-04-16 08:23:31
you would just clone your whole entity

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
class Player
{
  final int health;
  Player(){health = 100;}
  Player(int h){health = h;}
  takeDamage(int dmg){ return new Player(health - dmg); }
}

//...
Player user = new Player();
user = user.takeDamage(15);

2  Game Development / Newbie & Debugging Questions / Re: Identifying Subclasses on: 2014-04-15 13:45:57
@superminer362 please remove your fist example, it is the worst possible "solution" I can think of
3  Game Development / Newbie & Debugging Questions / Re: Over the top Error handling? on: 2014-04-09 15:33:28
evertime someone (a developer) is using your lib in a wrong way it is an programming error and you should throw an unchecked exception which hopefully terminates the app as quick as possible. Checked Exception should only be used for real "exceptions" something which is not a programming error (e.g. "a file doesn't exist").

ps: you should never use exceptions for logic
4  Game Development / Newbie & Debugging Questions / Re: Swing JComboBox problem. on: 2014-04-09 12:26:31
just override the toString method in Spritesheet
and the thing between the <> is called type argument
5  Game Development / Newbie & Debugging Questions / Re: [Scala] Finding the intersect of functions on: 2014-04-07 10:53:05
dunno, calculate the tangent yourself with a small sample size.


ps: you can probably write a solver macro to do all the hard work at compile time Cheesy
6  Game Development / Newbie & Debugging Questions / Re: [Scala] Finding the intersect of functions on: 2014-04-07 10:50:09
Let's say that you don't know anything about these functions (linear, quadratic whatever). You can than do a numerical approximation, most of the time in an iterative fashion.
The most common method was invented by Newton.

So you would subtract one of the function from the over and then with the help of the above method approximated the intersection point.
7  Game Development / Newbie & Debugging Questions / Re: My most inefficient way of implementing running texts. How to optimize? on: 2014-04-05 15:57:03
I did not take a good look at your code, but I see no reason why you would need so much state(class variables). So you probably can optimize your code in a way, so that the logic is more clear and easier to understand. Wouldn't you only need just one state variable? Namely the current char of the sentence you are drawing?
8  Game Development / Newbie & Debugging Questions / Re: vector formulas on: 2014-03-26 13:43:16
here have spoon full of delicious wikipedia
9  Game Development / Newbie & Debugging Questions / Re: vector formulas on: 2014-03-26 13:36:01
No, pls don't provide him with resources. Not that there aren't any vector classes just a single mouse click away on the internez. This such a trivial "problem" that you should just write them on you own, it will cost you 5min of your life.
10  Game Development / Newbie & Debugging Questions / Re: LWJGL and glslDevil on: 2014-03-26 01:15:04
These debuggers have a huge amount of features which can be very helpful.
  • profile your opengl calls. report unnecessary or costly calls, tell you which render calls took the longest
  • let you investigate why your screen is black. look at the current geometry, matrices ...
  • show active textures and state
  • explain why some pixel has this specific color

tools:
http://developer.amd.com/tools-and-sdks/heterogeneous-computing/codexl/
http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio-2/
https://developer.nvidia.com/nsight-visual-studio-edition-features
11  Game Development / Newbie & Debugging Questions / Re: LWJGL and glslDevil on: 2014-03-26 00:21:14
tryed all different OpenGL debuggers a while back and didn't get any to run with Java
12  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-25 17:39:06
I understand gene9 completely in the way that he is so enthusiastic about his favorite tool, but of course also the other side which is a bit annoyed about the derailing of this topic.

Let us just conclude that there is still many things which could make Java even better, slicker syntax or new JVM features.

And to give the syntax side of the discussion one more argument. Syntax like the try with resources is very needed, because it let us do the right thing without burden us with unnecessary boilerplate(having to close resource by hand in a safe way). For example a lazy keyword would be nice, because atm you need to have 10 LoC for each lazy field, if you want to do it correctly. The thing about other JVM languages is, that one doesn't has to wait for the next mayor release for new better syntax. In Scala i can just write it myself.
13  Game Development / Newbie & Debugging Questions / Re: Interface Design on: 2014-03-25 17:25:27
When talking specifically about interfaces, yes I believe it is good practise to use them a lot. The thing is, that this forces people to do composition over inheritance which is nice. Just don't over do it(like with everything), so pls no
ISomething, SomthingImpl
all over the code-base.
14  Game Development / Newbie & Debugging Questions / Re: Interface Design on: 2014-03-25 16:01:04
I have had a good look over LibGDX and how it is basically fully designed with interfaces.

Probably not a good place to look for good design. Just my two cents.
15  Discussions / General Discussions / Re: Scripting Language on: 2014-03-25 11:50:57
Anything the JVM can interprete on its own would be a plus I guess(e.g. JS as princec said), but I really see no benefits with scripting in general (on the JVM).
16  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-24 15:08:41
Or do it in a generic elegant way like Scala  Wink

where there are some global desugaring rules which can be used by anyone and any class.

i.e.
1  
2  
3  
4  
var(a)  += b
//is rewritten to
var.update(a, var.apply(a).+(b))
//you can also use any method besides "+" which has the correct types

17  Java Game APIs & Engines / OpenGL Development / Re: OpenGL enumerations on: 2014-03-24 14:28:38
yes OpenGL constants are constants  Wink
18  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-24 11:56:26
Imagine if Java allowed coding in full UNICODE?

Yep, as in Scala. Where library devs will include an actual lambda symbol(λ) in the public API , because who would need to be able to use the lib without IDE autocomplete anyways.

PS: I probably don't get what you are saying with syntax pollution, but in my opinion the current C like array syntax is syntax pollution. One could handle arrays as any other Collection, with no special type outside of the normal type system. That arrays are special buildings blocks for the JVM would be just a implementation detail. Also array covariance has to die!!
19  Games Center / WIP games, tools & toy projects / Re: Caelum Engine on: 2014-03-24 08:55:18
Unity is a full blow commercial game engine with tons of features,
this is a 1 month hobby project. Emo
20  Game Development / Newbie & Debugging Questions / Re: VBO Model Framework on: 2014-03-23 17:12:16
you probably should not use collada, it is a bloated inconsistent file format. Try something easier like MD5.
21  Game Development / Newbie & Debugging Questions / Re: MySQL and large user database on: 2014-03-20 08:36:50
The things is that you don't have this problem. You don't have 30k users atm and shouldn't worry about this yet.
Back on topic, nowadays as a start up one would probably rent some cloud solution which can easily scale to any user base possible.
22  Game Development / Newbie & Debugging Questions / Re: Matrix not working in shader on: 2014-03-15 08:30:31
you would have to set the matrix[3][3] to 1

no:

Quote
Matrices can be constructed from other matrices as well. A matrix can only be constructed from a single other matrix. The column and row values from the input matrix are copied to their corresponding values in the output; any values of the output not filled in are filled with the identity matrix.
OpenGL wiki
23  Game Development / Newbie & Debugging Questions / Re: Matrix not working in shader on: 2014-03-14 17:57:31
about the (4,5,0,0.1) => (40,50,0), this is because OpenGL devides xyz by w => 5 / 0.1 = 50

and sry I didn't know the exact behavior of the GLSL matrix constructors, it seems that if you whish do create a 4x4 matrix with 0.1, 0.1, 0.1, 1 on the diagonal you can do this
mat4(mat3(0.1))
24  Game Development / Newbie & Debugging Questions / Re: Matrix not working in shader on: 2014-03-14 15:40:50
What do you expect happens when you multiply with a 4x4 matrix where all values are 0.1?
25  Game Development / Newbie & Debugging Questions / Re: Inquiry about attribute locations in glsl on: 2014-03-12 06:40:24
only in modern GSLS version, I don't know atm 3.3 maybe.
26  Game Development / Newbie & Debugging Questions / Re: Compile and Debug Java on: 2014-03-09 10:01:36
Sometimes I think the only plausible explanation is that there is a huge Stockholm-Syndrom epidemic around the eclipse user base. Tongue
27  Game Development / Newbie & Debugging Questions / Re: Compile and Debug Java on: 2014-03-08 18:25:47
I ask because I have used netbeans and HATED IT with a passion

why?
28  Game Development / Newbie & Debugging Questions / Re: Do colored images take longer to load? on: 2014-03-04 23:50:13
I highly doubt that load times of a few images will be of any concern to you

fewer colours -> less data -> shorter time to read
29  Discussions / Miscellaneous Topics / Re: C++ standard library is really lacking - good or bad? on: 2014-03-03 08:51:52
A lot of C++ is used in places like the car industry where you want to programm robots or do complex offline physical simulations.
30  Discussions / Miscellaneous Topics / Re: C++ standard library is really lacking - good or bad? on: 2014-03-02 22:22:16
... a valuable skill.

Valuable, as in getting paid a lot of money to maintain some 20 year old rubbish code base. So if you are a masochist go for it.
Pages: [1] 2 3 ... 24
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (11 views)
2014-04-15 03:46:01

UprightPath (24 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (108 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!