Blue Fiend - updated and open sourced!

I always use brackets even if its just one line that needs to be executed. It’s more readable and consistent.

// Json

It can be found more readable, yes, but not more consistent ?? I dont understand why it would be ?

[quote=“DzzD,post:60,topic:33195”]
Maybe getting a bit to deep into semantics, but… brackets exists to define a scope.

the if/else/while statements have an implicit one-line scope.
class/static/method/synchronized/try/catch do not have an implicit scope.

[quote]brackets exists to define a scope.
[/quote]
ho… in fact… this is a lot more true :-X

it seems that most old statement have an implicit scope, while newer dont ? (try/catch for example)

Well if you have multiple lines of code you want executed after the if or loop or whatever you are REQUIRED to have brackets, hence its more consistent to always use brackets even if its just one line so all your blocks look the same. That’s my view at least :smiley:

// Json

this is also a good coding practice .
if you have a single command “if” , ex:

if (boolvar)
doThis();

and later you want to add another command subject to the same condition , you might do something like this :

if (boolvar)
doThis();
doThat();

it seems pretty stupid to commit such mistake, but I’d bet that everyone who is not adept to the brackets, already did this a few times - I admit I already did it.

If you use the brackets you can be sure you’ll never do such thing .

yes why not that’s not too much unlogical :persecutioncomplex:

Yay we convert someone to the bracket style :slight_smile:

In my younger years, I got converted twice. Ever since I use double brackets, even better!


if(condition)
{{
     
}}

noo!!! get out of myself !!

EDIT: i will still keep my unlogical :stuck_out_tongue:

and what about three brackets style ?

I’m working on it. It’s too hard. I really tried.

Anyway, it’s only a waiting game before somebody proposes the quadrupal brackets. Don’t you dare! Three is hard enough!

This is a finished game. Can it please go in the showcase section?

My favorite coding mistake was converting


if (boolvar) doThis();

to


if (boolvar);
{
    doThis();
    doThat();
}

:o

I spend days to find this…

IIRC, you can even setup the Eclipse compiler to generate a compile time error on empty statements. It can save you a few minutes per week :slight_smile:

I don’t really get why this isn’t in the showcase section. It’s pretty nice given it’s programmer art. Is the showcase only going to be for the people that have been doing this stuff long enough to have art/sound/music resources?

Kev

Thanks for your request to move this game to the showcase.

I did play this game a number of times yesterday and today and do think it is almost ready for the showcase.
The graphics are decent, it plays smoothly and is fun.

on the score side with the guidelines it score a 6.5/10 (being generous) while missing points for

-point if the game has “good” sound that suit the game
-point if the game’s overall style is “good”
-point if your judge enjoyed playing the game (1/2 a point here)
-point if the game is complete enough that doesn’t feel anything is missing

fix three issues and this can scrape into the showcase

  1. Game has timing problems, its runs way too fast on Linux (and probably Mac). I’m guessing this is due to you using System.currentTimeMillis() but could be due to a number of other factors.

  2. Game has no sound at all, I don’t expect full music and 3d sound effects, but simple beeps for firing and explosions would have sufficed for this style of game.

  3. Impact of Bullets, Theres no feeling/response of hitting enemies or getting hit by bullets, you kill an enemy and it just disappears, you get killed and the game just pauses with a game over message. Some sort of explosion or effect when enemies die and when you get killed would go a long way to making this a much more immersive and better game.

As much as I’d like to move this to showcase, just needs a bit more tweaking before I think its ready.

[quote]1) Game has timing problems, its runs way too fast on Linux (and probably Mac). I’m guessing this is due to you using System.currentTimeMillis() but could be due to a number of other factors.
[/quote]
actually I have still the same problem with my game.

in my case, its because bufferstrategy in windows / directx supports VSync beautifully, but with linux and opengl it doesnt work
so you have to write a true frameskipper