Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (576)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (626)
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 ... 68
1  Game Development / Newbie & Debugging Questions / Re: how to fit a body to a sprite avoiding transparent space? on: 2015-04-10 22:27:46
i mean to remove that part manually with an image editor software, what i´m looking for is a way to do it with code

So you want to crop an Image according to the sprite's minimum bounds?

- Iterate over the source image's pixels, recording the coordinates of the left-most, top-most, right-most & bottom-most non-transparent pixels.
- create a new image, sized according to these coordinates and copy over the source image, offset according to the left/top coords.
2  Discussions / General Discussions / Re: Methods of decompiled classes on: 2015-04-09 15:34:29
Perhaps something to do with the way the Server de/serializes instances of the world?
3  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-05 23:00:44
Tell me if I get something wrong here,
but no matter how much your computer compresses the data it recieves, it only recieves the entire file and compresses it clientside then, but doesn't decrease the amount of data recieved at all unless you also make the server use the compression method and send the compressed data...
The same goes for your upload, if you compress it clientside, the server will simply not be able to use this data, unless it knows how it has been compressed.

So how exactly do you, leaving the asked question apart, even plan to do this?

Typical approach is to have a server on the Internet backbone, acting as a proxy & doing all the compression of downstream (and decompression of upstream, where applicable).

Examples: Chrome's DCP, Mozilla's Janus, Opera's Turbo.
It's really only of meaningful applicability in the bandwidth constrained world of mobile internet, and even that is rapidly contracting.
4  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-05 16:19:01
PPP already offers compression though? (CCP)
If any given ISP wants to reduce bandwidth at the expense of latency and processing cost they're free to use it?

The end user shouldn't worry themselves with such issues; they're solely a concern of the network provider.
5  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 19:21:39
Are you sure the filesystem doesn't have a previous version of the file?

If the file has been on your harddrive for more than 24 hours, there should be a backup.
6  Discussions / General Discussions / Re: Java and GPU's on: 2015-03-14 22:02:17
   public final Font Charfont = new Font("Impact", Font.BOLD, 30);
   og.setFont( Charfont );
   og.drawRect( x,y+10,120,40 );
   og.drawString("Set up", x+26, y + 40 );

Use FontMetrics to position text.
7  Games Center / nK Game Competition - 2015 / Re: Java4K framework WIP / discussion on: 2015-02-26 17:17:41
I realize it's against the principle of the contest, but I guess there's nothing to stop participants from String-encoding compiled code - essentially turning it into a "16KiB minus encoding & instanciation overhead" contest.
8  Game Development / Newbie & Debugging Questions / Re: LibGDX:How to create Key Value pairing holding info for different datatypes on: 2015-02-25 14:01:52
Use json:


The implementation of getting data from json objects will differ from json lib to json lib.

Yeah, though I'd prefer a json lib to automatically instantiate & populate Java objects (using reflection).
If you're doing it properly, it should also have schema definition support. (though that seems a little beyond the scope of this thread)
9  Discussions / Miscellaneous Topics / Re: Bit pissed off at uk school system... on: 2015-02-10 18:59:30
Completely reasonable IMO.

Students are minors in the care of the school; the school has a duty of care towards the other students & staff.
If searching students is necessary to execute that duty of care, all power to them.
10  Game Development / Newbie & Debugging Questions / Re: Null pointer where there should not be all on: 2015-02-05 19:23:34
Rather than trying to solve the problem for you, I think it'd be more productive to explain how to solve the problem yourself.

Use a debugger.

If you run your code in Eclipse (or any other IDE), with the debugger attached, execution will halt as soon as an uncaught exception is thrown & you'll be able to inspect the state of every relevant variable in your program.

Terminal exceptions like this should be trivial to fix if you're programming with the correct tools & work process.
11  Game Development / Shared Code / Re: Sortable Map on: 2015-01-18 00:44:24
I think you'd be wanting Treemap.
12  Discussions / General Discussions / Re: How do you feel about selling out? on: 2014-12-28 02:40:03
IMO the sell outs are the consumers who buy into franchises, not the individuals who sell the franchises to mega-corps.

Judging products based upon their brand, rather than individual merit is a betrayal of the system & the greatest cancer of the games industry.

Without these lazy & ignorant consumers, the Minecraft IP would be nowhere near as valuable to Microsoft's milking department.
13  Discussions / General Discussions / Re: Lockable variables on: 2014-12-20 00:07:16
For global constants

That's your problem right there.
14  Game Development / Newbie & Debugging Questions / Re: Trouble making circular boundaries for 2D game on: 2014-11-10 22:47:00
Can't you just use the distance formula?

double distanceFromCircle = Math.sqrt( (player.x-circle.x)*(player.x-circle.x) + (player.y-circle.y)*(player.y-circle.y) );
if(distanceFromCircle < circle.radius){
   //ship is inside radius of circle

Where possible, always compare the squares.
15  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-11-01 08:02:30
Try using BufferStrategy.
Also stick some delays around switching into FSEM, as its interaction with the rest of the J2D API is prone to race conditions. (Even when it's all executing on the EDT)

It's a terribly unstable and unreliable API.

Also, spinning on Component.repaint() is terribly wasteful(flooding the EDT's EventQueue with repaint events) and is not guaranteed to achieve what you want it to.
16  Discussions / Miscellaneous Topics / Re: Draw a point or a dot. on: 2014-10-31 16:50:02
From what I recall, drawLine(x,y,x,y) is the preferred way of drawing just a single pixel through the general purpose rendering pipeline.
Obviously if you're doing a lot of individual pixels, then you should bypass the pipeline, and manipulate an Image's Raster directly
17  Discussions / General Discussions / Re: Paint program that allows full rotation? on: 2014-10-14 01:11:14
Hope you're not pre-rotating sprites persecutioncomplex

Nope Cool, I could draw the text in Java2D than rotate it, but I'd like to pre-rotate the text and save it in the .png VS. programmatically rotating the text to the desired angle every frame.

So rotate the text once, and draw it into an Image?

Embedding text in graphic resources is a bad habit that should be avoided whenever possible; makes localisation a lot more difficult.
Probably not a concern for your project, just something to keep in mind going forwards.
18  Discussions / General Discussions / Re: Paint program that allows full rotation? on: 2014-10-13 10:30:38
Hope you're not pre-rotating sprites persecutioncomplex
19  Game Development / Networking & Multiplayer / Re: Using UDP and TCP? on: 2014-10-12 12:45:45
UDP & TCP serve different purposes; if you have needs that are fulfilled by using both, then it's absolutely right to use both.

If it's any reassurance, there are lots of AAA games that use.
20  Discussions / Miscellaneous Topics / Re: Name that Poker hand - Tiny Code Challenge on: 2014-10-09 20:31:32
If they were using an older version of Java (circa Java 1.5), you'd be able to completely destroy the Java FizzBuzz highscore with this:

class S{static{for(int i=0;i<100;)System.out.println((++i%3<1?"Fizz":"")+(i%5>0?i%3>0?i:"":"Buzz"));}}

Back then the static initializer would execute before the main thread threw the "No Main method" error.
As that error is delivered to stderr, not stdout, it'd still fulfill the competition's requirements.

Alas, not to be.
21  Discussions / Miscellaneous Topics / Re: Name that Poker hand - Tiny Code Challenge on: 2014-10-09 20:14:39
For fizzbuzz? No, because the method declaration would be too large. It's such a tiny challenge there is no room for any fanciness.
The only one I used a recursive solution for was the sudoku solver.

Nah, for the Tiny Poker challenge.

Tbh I hadn't given it much thought, just emphasizing that micro-optimisation can only get you so far - an algorithmic change might give much more significant gains.
Though if the algorithm doesn't benefit from a virtually free & unbounded stack, it's unlikely recursion will offer a more efficient solution.

I did wonder if Java 8's lambda syntax might be able to give significant gains ( e.g. "myList.forEach(System.out::println)"), unfortunately the package locations of even the most basic class requirement (java.util.Arrays) sinks that idea pretty quickly.
22  Discussions / Miscellaneous Topics / Re: Name that Poker hand - Tiny Code Challenge on: 2014-10-09 14:41:45
I wonder if a recursive solution might be smaller.
23  Discussions / Miscellaneous Topics / Re: Is drinking half a bottle of vodka safe? on: 2014-10-09 14:32:24
Without your 'friend' noticing, replace the vodka with another clear colourless liquid and you're good to go! (so long as the replacement isn't Petrol....)
24  Discussions / Miscellaneous Topics / Re: [news] Windows 10 (9) on: 2014-10-05 14:55:57
It's laughable how being able to move and resize apps is being marketed as a feature.

...and why is the UI still composed of these hideous opaque rectangles?
Is it a case of the lowest common denominator? Microsoft wanting to present a consistent visual style between infinite-resource desktop & constrained-resource laptop/tablet?
If so they should shoot themselves for making such a compromise as it's uglier than Windows 3.1!

...and why is having search accessible from 2 places that are mere pixels away from one-another good design???
What's more important is that search ACTUALLY SEARCHES; Windows search hasn't worked properly since Windows XP.
If I search the root directory of my hard drive for all files containing a particular phrase, that's *precisely* what I want it to do - I don't want to restrict the search to indexed files, nor do I want to restrict the search to only a 'special' list of file types or locations.
Sure, use an index & file type priorities to accelerate easy searches, but DON'T lie to me by saying that you've finished looking & found nothing; until cancelled, a search should be exhaustive.

Also, why do a few UI tweeks justify:

a) a huge development team
b) a whole new product

Nothing I've seen so far justifies more than a simple patch developed by a lone student programmer.
The Windows code base must be so grotesquely bloated that making even the simplest change requires man months of effort.

It's time to incinerate it & start from scratch.
25  Game Development / Newbie & Debugging Questions / Re: NullPointerException or if statement on: 2014-09-30 11:30:35
Exceptional circumstance - > Exception

Missing resources is a perfectly acceptable example, though checking that they loaded properly in the first place is preferable (but not always possible).
26  Game Development / Game Mechanics / Re: Issues with gravity on: 2014-09-28 23:38:39
Have a Google for separating axis theorem and swept volumes.
27  Game Development / Newbie & Debugging Questions / Re: Storing and getting bounding boxes. on: 2014-09-27 22:48:17
Keeping them sorted on 1 axis is a very simple solution that, for a sparsely populated domain, can be very efficient.
28  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-30 16:55:08
Phenom II x6 1055T @ 3.36GHz,
8GB ram @ 1280MHz
Win 7 x64
HD 5870 @ stock

uncapped: 95-105 fps
29  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-28 14:52:25

Hard to tell if the drops are simply timing inaccuracy, or if it's actually failing to hit the fps cap.

Phenom II x6 1055T @ 3.36GHz,
8GB ram @ 1280MHz
Win 7 x64
HD 5870 @ stock

Didn't need to increase vm memory
30  Game Development / Newbie & Debugging Questions / Re: Lost my CODE! on: 2014-08-13 23:44:29
Anything recoverable from your Windows 'Previous Versions' ?
Pages: [1] 2 3 ... 68
ClaasJG (37 views)
2015-04-30 20:33:25

Riven (23 views)
2015-04-30 13:25:12

ClaasJG (42 views)
2015-04-27 13:36:51

BurntPizza (49 views)
2015-04-23 03:42:11

theagentd (51 views)
2015-04-22 16:23:07

Riven (61 views)
2015-04-16 10:48:47

Duke0200 (74 views)
2015-04-16 01:59:01

Fairy Tailz (56 views)
2015-04-14 20:13:12

Riven (61 views)
2015-04-12 21:36:37

bus hotdog (85 views)
2015-04-10 02:39:32
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 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‑
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!