Tag Info

Hot answers tagged

5

As others have said, the first step is separating logic that's shared from logic that's not. While it's great to draw that line wherever it's clear, your addendum illustrates that sometimes you don't have a clean line to split the code down. So, how do we solve cases where the client and server want to do semantically the same thing (play a sound), but take ...


1

It seems to me that you will need to perform some sort of Frequency analysis on the audio file in question. You could either pre-process the file on level load (using the data to queue up your level actions), or perform the analysis in real-time. Either way, you'll want to divide your audio waveform into sections, each comprised of N samples, and then ...


1

Why are you moving the viewport? You should only really touch it when the screen resizes. because you move the viewport everything outside it will not be drawn. instead adjust the view matrix to move the "camera" to where the player is this allows you to have larger levels as well.


1

The basic cause of the problem was that my value for screenY (2D location of mouseclick on Y-axis) was incorrect and so passing it to any valid picking ray function returned invalid results. My old working project got the mouse position values from the org.lwjgl.input.Mouse class whereas the new project is using java.awt.event.MouseListener. The lwjgl ...


1

Your map[][] is static so the three objects (layers) will access the same map (and overwrite it). You should make it nonstatic to allow each object to have it's own. Secondly the fileParser() method is private so you will have to either make it public or call it inside the class.



Only top voted, non community-wiki answers of a minimum length are eligible