Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  Print  
  Blue Fiend - updated and open sourced!  (Read 7228 times)
0 Members and 2 Guests are viewing this topic.
Offline Json

Jr. Member
**

Posts: 80



« Reply #60 on: 2009-04-24 03: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

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #61 on: 2009-04-24 11:39:24 »

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

Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #62 on: 2009-04-24 11: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.

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



Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Games published by our own members! Go get 'em!
Offline DzzD

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #63 on: 2009-04-24 12:18:36 »

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

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

Offline Json

Jr. Member
**

Posts: 80



« Reply #64 on: 2009-04-24 15: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 »

Sr. Member
*****

Posts: 463
Medals: 17



« Reply #65 on: 2009-04-24 15: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

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #66 on: 2009-04-24 15:47:56 »

yes why not that's not too much unlogical  persecutioncomplex

Offline Gudradain

Sr. Member
**

Posts: 371
Medals: 8



« Reply #67 on: 2009-04-24 18:27:22 »

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

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #68 on: 2009-04-24 18: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

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #69 on: 2009-04-24 18: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! Go get 'em!
Offline DzzD

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #70 on: 2009-04-24 18: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 ?

Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #71 on: 2009-04-24 19: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

JGO Ninja
***

Posts: 683
Medals: 7



« Reply #72 on: 2009-07-23 22:42:19 »

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

JGO Kernel
*****

Posts: 1940
Medals: 27



« Reply #73 on: 2009-07-24 10: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!
Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #74 on: 2009-07-25 08: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
Offline kevglass
« League of Dukes »

JGO Kernel
*****

Posts: 5214
Medals: 49


Mentally unstable, best avoided.


« Reply #75 on: 2009-07-25 13: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
*****

Posts: 2357
Medals: 59


★★★★★


« Reply #76 on: 2009-07-25 15: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

JGO Neuromancer
****

Posts: 1050
Medals: 18



« Reply #77 on: 2009-07-26 17: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]
  Print  
 
 
Jump to:  


Add your game by posting it in the showcase section.

The first screenshot will be displayed as a thumbnail.

obsidian_golem 2012-05-23 10:14:50

Danny02 2012-05-21 17:10:34

Danny02 2012-05-21 17:07:10

Danny02 2012-05-21 16:56:12

davedes 2012-05-21 13:59:23

obsidian_golem 2012-05-20 20:28:41

darkjava55 2012-05-12 16:14:40

Ultroman 2012-05-12 09:36:05

Ultroman 2012-05-11 22:49:53

Ultroman 2012-05-11 22:20:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.21 seconds with 19 queries.