Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  ignore  |  Print  
  Blue Fiend - updated and open sourced!  (Read 12694 times)
0 Members and 1 Guest are viewing this topic.
Offline Json

Junior Member


Exp: 7 years



« Reply #60 - Posted 2009-04-24 07:10:37 »

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

// Json
Offline DzzD
« Reply #61 - Posted 2009-04-24 15:39:24 »

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

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #62 - Posted 2009-04-24 15:55:07 »

brackets exists to make a bunch of code to appear as only one instruction/line

Maybe getting a bit to deep into semantics, but... brackets exists to define a scope.

[size=8pt]the if/else/while statements have an implicit one-line scope.
class/static/method/synchronized/try/catch do not have an implicit scope.[/size]


Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #63 - Posted 2009-04-24 16:18:36 »

Quote
brackets exists to define a scope.
ho... in fact... this is a lot more true  Lips Sealed

[size=10pt]it seems that most old statement have an implicit scope, while newer dont  ? (try/catch for example)[/size]

Offline Json

Junior Member


Exp: 7 years



« Reply #64 - Posted 2009-04-24 19:21:22 »

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

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 Cheesy

// Json
Offline teletubo
« League of Dukes »

JGO Ninja


Medals: 48
Projects: 4
Exp: 8 years



« Reply #65 - Posted 2009-04-24 19:39:44 »

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 .

Offline DzzD
« Reply #66 - Posted 2009-04-24 19:47:56 »

yes why not that's not too much unlogical  persecutioncomplex

Offline Gudradain
« Reply #67 - Posted 2009-04-24 22:27:22 »

Yay we convert someone to the bracket style  Smiley
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #68 - Posted 2009-04-24 22:51:28 »

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

1  
2  
3  
4  
if(condition)
{{
     
}}

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline DzzD
« Reply #69 - Posted 2009-04-24 22:52:19 »

Yay we convert someone to the bracket style  Smiley
noo!!! get out of myself   !!


EDIT: i will still keep my unlogical  Tongue

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #70 - Posted 2009-04-24 22:53:17 »

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

1  
2  
3  
4  
if(condition)
{{
     
}}


and what about three brackets style ?

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #71 - Posted 2009-04-24 23:00:55 »

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!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline CyanPrime
« Reply #72 - Posted 2009-07-24 02:42:19 »

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

JGO Ninja


Medals: 43



« Reply #73 - Posted 2009-07-24 14:06:32 »

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 .



My favorite coding mistake was converting

1  
if (boolvar) doThis();


to

1  
2  
3  
4  
5  
if (boolvar);
{
    doThis();
    doThat();
}


 Shocked

I spend days to find this....

Mathias - I Know What [you] Did Last Summer!
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #74 - Posted 2009-07-25 12:24:25 »

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 Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Online kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #75 - Posted 2009-07-25 17:32:19 »

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

Online kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #76 - Posted 2009-07-25 19:04:50 »

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.
Offline Cero
« Reply #77 - Posted 2009-07-26 21:04:45 »

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.

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

Pages: 1 2 [3]
  ignore  |  Print  
 
 

 
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!