Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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 ... 22
1  Discussions / General Discussions / Re: Global Game Jam (Jan 27-28) on: 2012-01-31 21:52:55
Here is mine!

It was built between me and my brother. We are pretty happy with the results, especially that we got it so polished.
2  Game Development / Newbie & Debugging Questions / Re: Help understanding the significance of using Java on: 2012-01-27 11:43:53
It could also be said that some of Java's slowness comes from writing code the Java way instead of the C way...
I would second this.

I've seen examples of Java code, where it tries to be as OO as possible. I've seen multiple examples were a developer will iterate over the pixels in an image, and turned each pixel into a brand new Color object. Removing that single piece of object creation, and instead working on the pixel as an integer, usually gives the biggest speed up.

But I have rarely encountered big speed issues with Java. When I have, it's normally that I'm doing a lot of work, rather then Java being slow. Most of the issues I have encountered are around garbage collection; again the idea that it's ok to constantly create and then let go of millions of objects (such as lots of bullets or heavily adding/removing items from a HashMap or LinkedList). However once you know about this, it is pretty easy to fix (an hour or two work at most). You can use one of the many open source (and well written) collections available online to lower the GC on collections; and by making the other objects (such as bullets) re-usable.

Overall, getting good performance out of Java is pretty easy. I work a lot in JavaScript, and I spend far more time finding ways to speed that up then I ever did with Java.
3  Game Development / Newbie & Debugging Questions / Re: Singletons on: 2012-01-25 05:41:47
oh boy, if I would ever listen to all the clean code bloat my current game would not be near demo status. Not even close Cheesy
If you pick the good bits, and use them wisely, then it can often end up saving you time.

I'm sorry but I had to smile on the "...end up saving you time" Smiley No offense I can understand the arguement but I am not doing any scalable software for a large company. I'm doing a game.
If it's a tiny game, then I agree. If it's something that you will be working on for a few months, and will be measured in 10s of thousands of lines of code, then it helps to follow good guide lines.

I have tonnes of bugs in my code, which have been caused simply because I have changed something else where. Good practices can help to isolate potential issues, and make them more durable to change. It also helps to avoid that "oh, f*ck" moment when you realise you need to build something that doesn't fit into the current system.
4  Game Development / Newbie & Debugging Questions / Re: Singletons on: 2012-01-24 00:13:30
oh boy, if I would ever listen to all the clean code bloat my current game would not be near demo status. Not even close Cheesy
If you pick the good bits, and use them wisely, then it can often end up saving you time.
5  Game Development / Newbie & Debugging Questions / Re: Singletons on: 2012-01-23 18:04:42
#2 code that is reusable by anyone.
in this case you are expected to use the best style, documentation - basically everything good and nothing bad
this software is designed to be used by others for anything - therefore it has to be structured as good as possible

as #2 is the standard case when developing software, this is the default answer
I disagree, it's much complex then that, because using code and maintaining code are not the same. You can't really place them into the same bucket.

Externally, code should aim to have clean APIs, with no quirks and gotchas. However internally, code often needs to use anti-Software Engineering methods to gain performance, and to implement/fix corner cases with public API usage.

In my experience there are very few good solutions. It is often a case of picking the best bad solution, and boxing it's negative aspects into a corner so they are better isolated from the good code.
6  Game Development / Newbie & Debugging Questions / Re: Singletons on: 2012-01-23 16:27:54
It isn't that singletons, or globals, are automatically bad. It is that lots of them often lead to problems with re-factoring and maintaining code. Namely:

  • Singletons presume there will only ever be once instance; the moment you need a second (including wrapping or replacing the first) you run into issues
  • Where are they used? Where is it setup? Passed objects around leaves a paper trail, which is much easier to follow.
  • Some singletons require being initialized/setup before use, and so you can often you call into code which presumes you have done this, and then errors mysteriously when it's not been done. It's much worse if this is done in multiple places, or if you have two sections of code that both want setup the singleton in different ways.

I have used singletons for handling sound in games, for hiding OpenGL contexts behind a 'more OO' interface, and for when I've wanted to pass a single reference into a constructor without exposing it in the interface (I do this in an MVC framework I built where all Controllers have a reference to the core Framework instance). In all cases, they worked perfectly, and I've had no issues.

I have also been given code that has required anywhere from 1 to 40 global variables being initialized, before calling into various different pieces of code, without that information ever being documented (different variables also needed for different code paths). Although that is with globals, you can build a similar mess with Singletons.

For player stats, it'll work fine, if there is only ever one player. The moment you want more players, such as multiplayer or by faking them as computer opponents, you can start to run into issues. If you do keep the singleton, I'd at least try to touch it as little as possible, so it's easier to rip out if you ever change your mind.
7  Discussions / General Discussions / Re: best way to learn java on: 2012-01-20 14:21:03
I would take a look at Objects First with Java.

It the best book I have ever seen for learning to program, for any language. It starts off with very, very basic stuff, and ends up covering about 90% of the Java language (only very advanced stuff is missing). It also includes more advanced topics later on building GUIs, debugging, unit testing and ways on working out issues before you program. It works hand in hand with BlueJ, a learning IDE, which is awesome for beginners.

What is also important is that it tries to teach you the real concepts behind programming in Java, about object-orientation. For each chapter it includes examples and assignments, so your always coding as you learn new concepts. Many of these end with suggestions for more advanced stuff you can try to solve.

If that isn't enough of a recommendation, it is also used by 1,000s of schools and universities around the world, to teach Java to new students.
8  Discussions / General Discussions / Re: Programming language decisions on: 2012-01-20 11:41:06
I'm old-school and think everyone should learn to program *without* using an IDE at first.  It demystifies what's actually going on.  Especially since Eclipse (for example) hides the compile step from you.  Newbies often seem to not see the line between the IDE, the compiler, and the language.
I learnt programming at University using BlueJ, and I saw exactly what you are talking about happen with other people in my year. People thought it was BlueJ that allowed them to run applications, and not Java.

But in many of those occasions, I think just sitting them down after they have learnt to code, and going through running Java from the command line, would have solved that issue in an afternoon.
9  Discussions / Miscellaneous Topics / Re: Have you ever been Jumped/Beaten up? on: 2012-01-20 11:37:40
@princec:
Because people can read body language. And you started sending out all the wrong signals.

It depends a lot on where you live.

I have lived in Birmingham for over 20 years, and apart from the story I posted above, I have never had anyone intimidate or hassle me in any way. Same was also true when I lived in Hong Kong.

In contrast, when I lived in Canterbury for 4 years, over that time people would drive past and shout abuse on an almost monthly basis (for the whole 4 years). Also happened on the only time I visited Margate. I also had lots of occasions in Canterbury where people would threaten me whilst I walked home.
10  Discussions / Miscellaneous Topics / Re: Have you ever been Jumped/Beaten up? on: 2012-01-18 18:09:08
I was walking past a bus stop where there were three Asian guys. As I went past one of them said something about me being white, and then hit me in the face. Left my bottom lip bruised and bleeding.

I ran off, immediately phoned the police, and within 10 minutes I was doing a drive by identity parade (at least three police cars turned up within the first 5 minutes). So much animosity gets thrown at the Police in the UK, with people regularly stating that they wouldn't care about minor crimes and assaults, but it's entirely untrue. I was really impressed with how seriously they took the whole event, and the effort they went to in order to try to convict them in the weeks following the assault.

However despite me identifying them in the drive by, and later in a video line up (where the officer said it was the first time he had someone correctly identify the suspect), the CPS chose not to prosecute.

Before then, I regularly went out, and had no issues walking home on my own, and didn't care if there were groups of people coming in the other direction. I still have no issues walking home at night, but do think "what if", when I see a group of people coming my way. All because that one guy chose to randomly attack me; that's what annoys me the most about it.
11  Discussions / General Discussions / Re: Programming language decisions on: 2012-01-16 19:26:39
Can you write java code withOUT an IDE? Using only notepad++, or some equivalent software for linux / mac?

(personally, I can't. I use Eclipse, and I'm happy with it)
Yes, trivially.

However Java is one of the few languages where I prefer a full IDE (although with a few minor changes to Visual Studio, I'd happily use that for JavaScript).
12  Discussions / General Discussions / Re: Programming language decisions on: 2012-01-15 02:31:06
Also I really like the look of Windows 8 Metro, and I'd love to build something with it. That is another reason I would pick C# over Java (although JavaScript might be a better choice since you could also port it to work on the web).
13  Discussions / General Discussions / Re: Programming language decisions on: 2012-01-14 05:54:03
All three languages include:
  • Examples of excellent games built using them
  • Implementations with excellent performance (even when one is shown to be slower, it's still damn fast)
  • Mature and battle tested implementations
  • Large and active communities
  • learning examples
  • Tutorials
  • lots of game-related libraries
  • tonnes and tonnes of other libraries (which you'll need too)
  • on going development (with both implementation and libraries)

My overall point is that isn't any real reason why you should use one over the other; they are all excellent.

But if I had to chose, it would be between C# and Java, but probably leaning towards C#. This is because I've seen tonnes of excellent stuff with C# that I'd love to use, and I like languages that run with adding new features (so I have more stuff to play with). I also develop pretty much exclusively on Windows, so I'd prefer good Windows support then cross platform. C# also has more, and larger, game development communities. However Java has NetBeans, which for Java development, is enough of a reason for me to use Java for a project.

If your really stuck, flip a coin, or roll a dice to decide. You can't pick a bad option.
14  Game Development / Newbie & Debugging Questions / Re: Real Time Combat Collision on: 2012-01-10 02:52:37
@GabrielBailey74 Thanks, I mean how to handle the collision of the attack, like if the attack is button is hit, do you just add a "hitbox" to a list in the game world and then test it against enemies in range as Mads stated?

Or do you just have one "attack hitbox" in the player class, that gets manipulated based on the current weapon and when cycling through the game world entities, check if player is attacking and if it is, test that hitbox against nearby enemies.
Either approach is fine. A hit box is just 4 values; x, y, width and height. Updating them on the fly, or event creating a new box, is going to be fairly cheap.

Personally I would have hit boxes created for each weapon, and stored within them, or at least the information needed to create the box on the fly. This way you can just do 'weapon.getHitBox()', or something similar, to get it's hit box without having to know any of the details.

If the weapon (or player) is the one doing the test, then the weapon's hit box also doesn't need to be indexed in the quad-tree/grid/whatever, just the enemies. The weapons hit box can be passed into the tree when retrieving enemies that intersect it.

The only time the weapon will need to be stored is if you are testing enemies against the weapon; i.e. the collision check is contained in your Enemy class.
15  Discussions / Miscellaneous Topics / Re: Play My Code on: 2012-01-06 18:12:05
and SkyBrush, the painting app I built for the site, is now a Chrome Experiment. I'm so happy!
16  Discussions / General Discussions / Re: What is your favorite layout? on: 2011-12-27 20:39:39
My games always have a fixed-size frame and therefore I always just use the 'null'-layout and set the dimension and coordinates for each component manually.
It's easy and straightforward. I'm surprised that apparently nobody else does it this way.
For applications, fixed size normally is often not very friendly.
17  Discussions / General Discussions / Re: Canonical to remove Oracle's Sun Java from User's Systems on: 2011-12-22 21:53:09
Quote
In the near future (exact date TBD), Canonical will remove all Sun JDK
packages from the Partner archive. This will be accomplished by pushing
empty packages to the archive, so that the Sun JDK will be removed from all
users machines when they do a software update. Users of these packages who
have not migrated to an alternative solution will experience failures after
the package updates have removed Oracle Java from the system.

and people say backwards compatibility is bad on Windows.
18  Discussions / Miscellaneous Topics / Re: Play My Code on: 2011-12-22 21:35:59
The power of HTML5 still amazes me. Really nice image editor. I did however find 1 bug, the brush doesn't draw when I click somewhere, it only draws when I click and drag. Otherwise, really amazing tool thanks!
Noted, I'll get that fixed.

Otherwise thanks! and I too am amazed at how much HTML5 is coming along. Especially since I'd imagine this would have taken much longer in something else.
19  Discussions / Miscellaneous Topics / Re: Play My Code on: 2011-12-22 13:31:16
About a week or two ago we made a major update for PMC. Lots of small additions around the site, but most of all the IDE now has an image editor in-built!

The image editor is also available on it's own here. I put it together over the last 6 weeks after I was a little disappointed by those I saw online (most were great, but none had all the full features I wanted).
20  Game Development / Newbie & Debugging Questions / Re: Flickering applet on: 2011-12-20 04:33:32
See my comment here.

It's a known issue with Mac OS. Essentially the applet can't own the context it is drawing to, because the JVM plugin now runs in a separate process. To get around this it does some copy/update magic, but the downside is that applications that update constantly (like games), flicker horribly. You can drag the applet out into it's own window (I don't know specifically how, as I don't use Mac OS, but you can), where it owns the Window, and so avoids the copy/update issue.

Other OS's are unaffected because Mac OS has a more restrictive security policy around window ownership between processes. I believe on Mac OS they have to be explicitly given from one process to another, which browser's currently aren't built to do.

I believe the 32-bit JRE is unaffected, as the JVM doesn't run in a separate process; this is simply because it is out dated. But these days most browsers will use the 64-bit JRE by default (I believe you can only get 64-bit on Lion), and some browsers will only use the 64-bit version (if I remember correctly, Chrome does this).
21  Discussions / General Discussions / Re: What is your favorite layout? on: 2011-12-19 00:24:48
This is one thing I didn't like about Swing. The only way I could even get GUIs to always line up elements perfectly, whilst also flowing exactly how I want to, I have to use BorderLayouts, BorderLayouts, BorderLayouts, and yet more BorderLayouts, all heavily nested within endless JFrames.

Occasionally I'll use a Flow or Grid layout somewhere, but often it ends up getting switched out into lots more BorderLayouts.
22  Discussions / General Discussions / Re: Java Lambdas Finalised! on: 2011-12-14 23:16:16
Yeah your right, I had the idea that you could override a class and make fields become protected or public, like with methods.

Learn something new every day!
23  Discussions / General Discussions / Re: Java Lambdas Finalised! on: 2011-12-14 21:21:00
I'd also go further, and say that it should be impossible to expose fields and private methods outside of a class. If a subclass or mixin were to define a private method or field with the same name, then it would be a separate field or method. So both a super and sub-class can both have the field 'foo', with no issues with them conflicting (since each has their own 'foo').

That way the only place conflicts and overriding behaviour can occur is around exposed method signatures, and so helps to avoid unexpected behaviour.
24  Discussions / General Discussions / Re: Java Lambdas Finalised! on: 2011-12-14 18:38:51
I don't believe the solution is to allow interfaces to include behaviour code, that defeats the point of an interface, and we have abstract classes for that. Multiple inheritance is also not the solution.

Personally I believe you need mixins, or something similar, to solve this issue.
25  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-12-11 12:15:04
I wouldn't worry too much about missing JS support, especially since this is for your students. The important thing is to say that JS is required when it's disabled (using <noscript> tags), and to ensure the page doesn't look messed up. You shouldn't need JS for most layouts, especially not for anything which is shown when the page is first shown (although this depends on what your building).

The only people who tend to disable JS are those who are more technical, such as programmers, and so they can (usually) get that they will miss stuff by doing this. Plus the idea of building everything twice is overrated, and often incentives developers to make their sites a little less ajaxy (and so feel less fluid).
26  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-12-08 13:22:01
1 No predictive text insertion in Netbeans or eclipse AFAIK. In java i can type a variable and then press '.' and the IDE will show all of its fields and methods. Not so when using javascript, i guess because it is not strongly typed.
Try Visual Studio, this does have auto-completion.

2 No exceptions and javascript just silently fails when there's an error. I think I need fire bug to solve that, but why can't the IDE just catch it?
Yes it does. With IE 6 (and some other IE versions) the error was shown to the user, and this meant if you went to a broken page, you would receive half a dozen script error dialogues. Due to the annoyance of this, errors are hidden from users, until shown.

In Firefox you can see errors using the error console (ctrl+shift+J), or through Firebug (right click, inspect). Chrome, IE, Opera and Safari all have equivalents for displaying thrown errors in one form or another, and include their own DOM navigators and debuggers. You can also get Firebug Lite for non-Firefox browsers.

3 To do anything useful on the web I need to learn 5 different languages: HTML, javascript, PHP, CSS and SQL with all of their little ridiculous peculiarites. These range from different ways to declare variables (var vs $) to different ways to doing comments (// vs /*  */ vs <!-- -->).
You can use JavaScript server side too, and you could take a look at Ruby which is much nicer to write than PHP.

Tbh any real web development rarely uses lots of SQL directly, as it's pretty common to use an ORM. There are plenty around, and I even wrote my own over about 2 days so I could avoid SQL in PHP.

HTML/CSS vs pages of Java just comes down to personal taste.

4 No definitive javadoc equivalent, I have to search random crap on google to find answers and ways of doing things.
Check out the Mozilla reference or the MSDN. I also find Quirksmode useful for looking up compatibility, although it's often only accurate on popular stuff.

The specs are also online, which state the objects, attributes and methods that different standards support. Some of these are massive, and go into lots of detail, but some like the one for the Canvas element, are invaluable.

5 The 'DOM tree' is silly. It doesn't make sense that everything is a node, including attributes, yet attributes are not children of the nodes that they belong to and they have no parent. In that case attributes shouldn't be nodes!
I presume you are talking about 'setAttributeNode' and 'getAttributeNode'? They are rarely used, and I didn't know they existed until you mentioned them. Try 'getAttribute' and 'setAttribute' instead. Attributes aren't nodes, they are key-values stored on the DOM nodes, it just happens that those two methods give a 'node-like' interface.

However it's common for only library writers to work directly on the DOM. Everyone else just uses jQuery (or similar).

6 All the browsers have different ways of doing things.
Use jQuery.

7 The crazy mixture of manipulating the DOM with text using element.innerHTML="stuff" vs doing it using DOM nodes, which are supposed to give the same result but often don't.
Again, use jQuery.

8 Trial and error lucky dip approach of programming in javascript where anything may or may not work and it's not clear why.
Check your errors. Even when you just get a browser specific error code, it's often enough to be able to look up the issue.

I hope that helps!
27  Games Center / LWJGL16k - 2011 / Re: We have a website! on: 2011-12-03 04:13:50
I think you should also move all content to the centre column, especially the footer. It looks a bit strange with how it is right now.
28  Games Center / LWJGL16k - 2011 / Re: We have a website! on: 2011-12-01 19:25:59
It's a start, but could use a lot of work!

Of all the things that could be improved, I'd change the sub-headers, as they look like text inputs (I even clicked on the 'search' one accidentally before noticing the input underneath). Here is something I quickly hacked in Firebug:
1  
2  
3  
4  
5  
6  
7  
8  
9  
DIV.sidebar H3 {
    border: none;
    border-bottom: 1px solid #990033;
   
    color: #990033;
    display: block;
    margin-bottom: 0.5em;
    text-transform: uppercase;
}
29  Discussions / Miscellaneous Topics / Re: JGO Keyboards on: 2011-11-30 18:57:15
I'm used to a generic keyboard, but what I really really really want ...
http://www.artlebedev.com/everything/optimus/demo/

Every key has a little LCD screen in it, and it's awesome!
They do look awesome, but I've heard the keys have a high resistance, and so typing can actually get quite tiring.

For my mouse I use a trackball, a Logitech Marble Mouse.

Once your used to it, trackballs aren't that different to using a mouse, but I certainly prefer them. The biggest wins being that they save a lot of space, are more accurate, and it's easier to move the mouse pointer continuously.
30  Discussions / General Discussions / Re: New feature: caching on: 2011-11-28 15:10:17
I was mainly thinking out loud, I don't seriously think JGO should drop SMF any time soon. I just really don't like the mass of categories you get on these old style boards (in general, not in particular aimed at JGO), and they are rarely that ajaxy. Lots of modern alternatives tend to allow you to do just as much, with less page changes and clicks.
Pages: [1] 2 3 ... 22
 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (10 views)
2014-12-27 04:03:04

TheDudeFromCI (13 views)
2014-12-27 02:14:49

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (56 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (92 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (94 views)
2014-12-03 16:27:13

CopyableCougar4 (102 views)
2014-11-29 21:32:03
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

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