Jump to content

  • Log In with Google      Sign In   
  • Create Account

Wyrframe

Member Since 28 Jun 2000
Offline Last Active Sep 14 2014 03:04 PM

Posts I've Made

In Topic: Removing heart from life bar the correct way

13 April 2013 - 12:27 PM

warnexus; if you're using Swing or AWT, either repaint() (to request a repaint at the next opportunity) or revalidate() (to request re-layout of LayoutManager-arranged components, and repaint if necessary) are the correct methods to invoke on the container (the object retrieved by getHeartPanel()).

In Topic: Isometric tilemap rendering

27 February 2013 - 10:21 PM

If you're wanting to render using the depth buffer to do layering for you, you should ideally be actually placing your scene contents in real 3D space. At the very least, you need to have different Z values for objects at different depths, or else the depth buffer is doing nothing at all. If you want to manually composite the depth of the scene using old-school 2D-esque sorting techniques, then disable the depth buffer, set the Z bounds to -1,+1 (you're currently using 0.0f,100.0f), and go wild with objects at Z=0. There are places for mixing the two, but most of them are in the realm of scene composition effects like distortion, full-screen shaders, etc.

In Topic: Question about Eclipse, JDK, JVM and JRE

15 February 2013 - 02:09 PM

Eclipse; an editor and build-management environment.

 

JVM: Java Virtual Machine: the program, implemented differently for different platforms, that runs the java bytecode created by the compiler.

 

JRE: Java Runtime Environment. Usually the Oracle or GNU implementation. Contains a JVM and the standard library implementation, but no editors or compilers. It's meant to provide a complete but only sufficient runtime environment.

 

JDK: Java Development Kit: the JRE, plus a compiler.


In Topic: Joystick sign conventions

15 February 2013 - 03:18 AM

Under Windows, most gamepad interfaces (such as what DirectX and LWJGL expose) provide a way to query the names of each axis and sometimes button, so even if you're not sure about the numbering convention, you can check the human-readable string names for X+, Y-, et cetera.

 

This is particularly helpful if someone is using an XBox 360 controller. I discovered (quite to my consternation) that up until a year or so ago, it sometimes had the left joystick X/Y axis numbered 1/0, and the right joystick X/Y numbered 2/3. More recently, I've found it's consistently numbered the same as my other dual-stick gamepads (LX,LY,RX,RY numbered 0,1,2,3 in that order).


In Topic: if statement in for loop, brackets needed?

10 February 2013 - 09:30 AM

I use unbraced forks only for if-wrapped return, continue, break, and throw statements, because those don't have "else" forks; any subsequent code is an "else" after that.

 

But, I also tend to write very dense loops, frequently without an actual body, so sometimes the body of my loops ends up being a single semicolon, ie

for(int i=0, j=arraylength-1; i<j; array[j--]=array[i++]) ;

 

And that just becomes more unreadable when I waste essentially blank lines putting empty braces on the following couple lines.


PARTNERS