www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Atomorun2008 Opensource

reply Matthias Thurau <Matthiasth gmx.de> writes:
Hello,

As a Reminder: Atomorun2008 is a free 3D Jump n Run Game written in D.

After a while and some feedback from some users in the last time, i decided to
publish the sourcecode of Atomorun2008 under GPL. Frostwork aka Marcel Unbehaun
released Linux and Mac OS X versions of the Game, too.

So if you are interested: Atomorun2008.whosme.de
Aug 20 2008
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Matthias Thurau:
 So if you are interested: Atomorun2008.whosme.de
struct Vertex { public: Point3D position; Point3D normal; }; D Structs don't need a semicolon at the end, and their fields are always public. myLetters[currentLetter].uv[0].x = cast(float) letterstartxl / myDimension; myLetters[currentLetter].uv[0].y = cast(float) (y *maxlettersize) / myDimension; myLetters[currentLetter].uv[1].x = cast(float) letterstartxr / myDimension; myLetters[currentLetter].uv[1].y = cast(float) (y *maxlettersize) / myDimension; myLetters[currentLetter].uv[2].x = cast(float) letterstartxr / myDimension; etc... To shorten that code you may use: with (myLetters[currentLetter].uv) {...} void clear() { //check and unload non needed resources ... }; No need for the semicolon after the last } of a method. And I suggest you to put one blank line between methods. struct Point2D and struct Point3D can be merged into a single templated code, that can work with N coordinates, reducing code duplication... Generally I see many points where the code can be shortened, there's some redundancy. Generally I suggest to specify what names you import: import foo: bar, baz, ect; Bye, bearophile
Aug 20 2008
next sibling parent reply JAnderson <ask me.com> writes:
 struct Point2D  and struct Point3D can be merged into a single templated code,
that can work with N coordinates, reducing code duplication...
They could be but normally Point2D and Point3D have pretty specific operations that don't scale well. -Joel
Aug 20 2008
parent downs <default_357-line yahoo.de> writes:
JAnderson wrote:
 struct Point2D  and struct Point3D can be merged into a single
 templated code, that can work with N coordinates, reducing code
 duplication...
They could be but normally Point2D and Point3D have pretty specific operations that don't scale well. -Joel
But since they also have lots of code in common, put them into a template and wrap the unique code into static ifs. Look at dglut.vector for an example of templated coordinate structs.
Aug 20 2008
prev sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"bearophile" <bearophileHUGS lycos.com> wrote in message 
news:g8iec6$1cc7$1 digitalmars.com...

 No need for the semicolon after the last } of a method. And I suggest you 
 to put one blank line between methods.

 Generally I suggest to specify what names you import:
 import foo: bar, baz, ect;
Uh, I'm not sure where you got the idea that you can tell other people what coding style they should use, but typically it doesn't work ;)
Aug 21 2008
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Jarrett Billingsley:
 Uh, I'm not sure where you got the idea that you can tell other people what 
 coding style they should use, but typically it doesn't work ;)
I'd love people to criticize my code :-) In the the creative literary mailing lists I follow I am used (and even supposed too) to comment/criticize everything people shows in the group. So I am trying to... improve this group encouraging people to look at each other code to suggest things, etc. A community of writers doesn't need to be too much different from a group of programmers :-) The things I have said here aren't just "coding style", for example I have avoided suggesting things like where to put the brackets, how much indent use, etc. The things I have suggested, like to not put "private" inside structs seems more important, closer to being code bugs (despite not being bugs). Walter has written some conventions for D and I think it's positive to follow some of them (even if maybe Tango doesn't follow some of them). Bye, bearophile
Aug 21 2008
parent reply Mike Parker <aldacron gmail.com> writes:
bearophile wrote:
 Jarrett Billingsley:
 Uh, I'm not sure where you got the idea that you can tell other people what 
 coding style they should use, but typically it doesn't work ;)
I'd love people to criticize my code :-) In the the creative literary mailing lists I follow I am used (and even supposed too) to comment/criticize everything people shows in the group. So I am trying to... improve this group encouraging people to look at each other code to suggest things, etc. A community of writers doesn't need to be too much different from a group of programmers :-) The things I have said here aren't just "coding style", for example I have avoided suggesting things like where to put the brackets, how much indent use, etc. The things I have suggested, like to not put "private" inside structs seems more important, closer to being code bugs (despite not being bugs). Walter has written some conventions for D and I think it's positive to follow some of them (even if maybe Tango doesn't follow some of them).
In literature, the written word is the end product, which should be as 'polished' as possible. Software is polished in terms of functionality and presentation. Which features of the language to use in the source itself ('with' statements, templates, and so on) is a choice of personal discretion (or team coding standards). Your suggestions are nowhere near the equivalent of helping someone improve a literary work. If your post of unsolicited suggestions had been directed at me, I'd ignore the whole thing and be rather annoyed at you for doing so. Just because you don't need to add 'public' to struct fields doesn't mean you shouldn't. Some, myself included, would argue that it improves readability. Just because Point objects share a lot of similar code doesn't mean they *have* to be implemented as templates (as suggested by downs). Personally, I avoid templates for such simple cases. You say this isn't the same as telling someone where to put the brackets, but in effect it is because there's no 'right' way. Sure, source should be readable so that others can pick it up. But an important aspect of readability is consistency. Whether or not you use 'with' statements is less important that whether you do so or don't do so consistently.
Aug 21 2008
parent reply Matthias Thurau <Matthiasth gmx.de> writes:
Mike Parker Wrote:

 bearophile wrote:
 Jarrett Billingsley:
 Uh, I'm not sure where you got the idea that you can tell other people what 
 coding style they should use, but typically it doesn't work ;)
I'd love people to criticize my code :-) In the the creative literary mailing lists I follow I am used (and even supposed too) to comment/criticize everything people shows in the group. So I am trying to... improve this group encouraging people to look at each other code to suggest things, etc. A community of writers doesn't need to be too much different from a group of programmers :-) The things I have said here aren't just "coding style", for example I have avoided suggesting things like where to put the brackets, how much indent use, etc. The things I have suggested, like to not put "private" inside structs seems more important, closer to being code bugs (despite not being bugs). Walter has written some conventions for D and I think it's positive to follow some of them (even if maybe Tango doesn't follow some of them).
In literature, the written word is the end product, which should be as 'polished' as possible. Software is polished in terms of functionality and presentation. Which features of the language to use in the source itself ('with' statements, templates, and so on) is a choice of personal discretion (or team coding standards). Your suggestions are nowhere near the equivalent of helping someone improve a literary work. If your post of unsolicited suggestions had been directed at me, I'd ignore the whole thing and be rather annoyed at you for doing so. Just because you don't need to add 'public' to struct fields doesn't mean you shouldn't. Some, myself included, would argue that it improves readability. Just because Point objects share a lot of similar code doesn't mean they *have* to be implemented as templates (as suggested by downs). Personally, I avoid templates for such simple cases. You say this isn't the same as telling someone where to put the brackets, but in effect it is because there's no 'right' way. Sure, source should be readable so that others can pick it up. But an important aspect of readability is consistency. Whether or not you use 'with' statements is less important that whether you do so or don't do so consistently.
I agree with you. I was not very interested in the fact that i dont have to put a ; at the end of a struct or function or whatever :) Sometimes you need it and sometimes you dont need it. But if you put it there and don t need it, it is most times not wrong. So i prefer to put it always there. Maybe it is, or maybe not: But i think on an Announcement forum, there shouldn t really be a discussion about coding style. In general its good to help people with style and so on. I am willing to learn, too. But i think this is the wrong place for it!
Aug 22 2008
parent reply "Saaa" <empty needmail.com> writes:
I disagree with you there ;)
The parent post is the announcement, the children the discussion. Would you 
rather have bearophile create a new post about criticism on your code in 
.learn?

Ignore the stuff you don't care about, but I wouldn't want the newsgroups to 
withhold critique just because people might get annoyed by it.

I learn from the criticism directed at your code, even if it doesn't help 
you, it helps me and that is the important thing to remember.

I want people to totally annihilate the code I show.
One should learn not to feel annoyed, ever. In no single situation is it 
useful.


 I agree with you. I was not very interested in the fact that i dont have 
 to put a ; at the end of a struct or function or whatever :) Sometimes you 
 need it and sometimes you dont need it. But if you put it there and don t 
 need it, it is most times not wrong. So i prefer to put it always there.

 Maybe it is, or maybe not: But i think on an Announcement forum, there 
 shouldn t really be a discussion about coding style. In general its good 
 to help people with style and so on. I am willing to learn, too. But i 
 think this is the wrong place for it! 
Aug 22 2008
parent reply Matthias Thurau <Matthiasth gmx.de> writes:
 
 I disagree with you there ;)
 The parent post is the announcement, the children the discussion. Would you 
 rather have bearophile create a new post about criticism on your code in 
 .learn?
 
 Ignore the stuff you don't care about, but I wouldn't want the newsgroups to 
 withhold critique just because people might get annoyed by it.
 
 I learn from the criticism directed at your code, even if it doesn't help 
 you, it helps me and that is the important thing to remember.
 
 I want people to totally annihilate the code I show.
 One should learn not to feel annoyed, ever. In no single situation is it 
 useful.
 
 
 I agree with you. I was not very interested in the fact that i dont have 
 to put a ; at the end of a struct or function or whatever :) Sometimes you 
 need it and sometimes you dont need it. But if you put it there and don t 
 need it, it is most times not wrong. So i prefer to put it always there.

 Maybe it is, or maybe not: But i think on an Announcement forum, there 
 shouldn t really be a discussion about coding style. In general its good 
 to help people with style and so on. I am willing to learn, too. But i 
 think this is the wrong place for it! 
Who said that i am annoyed? I am not.
Aug 22 2008
parent "Saaa" <empty needmail.com> writes:
 Who said that i am annoyed? I am not.
I see, got those two posts mixed up a bit, I think it was more directed towards Mike, sorry :)
Aug 23 2008
prev sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Thu, 21 Aug 2008 10:46:17 -0400, Jarrett Billingsley wrote:

 "bearophile" <bearophileHUGS lycos.com> wrote in message
 news:g8iec6$1cc7$1 digitalmars.com...
 
 No need for the semicolon after the last } of a method. And I suggest
 you to put one blank line between methods.

 Generally I suggest to specify what names you import: import foo: bar,
 baz, ect;
Uh, I'm not sure where you got the idea that you can tell other people what coding style they should use, but typically it doesn't work ;)
I a agree with bearophile's reply. As long as you stay away from well known arguments, suggesting better style constructively is good, especially in a new language that may allow for some new ways.
Aug 21 2008
prev sibling next sibling parent reply Jesse Phillips <jessekphillips gmail.com> writes:
On Wed, 20 Aug 2008 12:49:36 -0400, Matthias Thurau wrote:

 Hello,
 
 As a Reminder: Atomorun2008 is a free 3D Jump n Run Game written in D.
 
 After a while and some feedback from some users in the last time, i
 decided to publish the sourcecode of Atomorun2008 under GPL. Frostwork
 aka Marcel Unbehaun released Linux and Mac OS X versions of the Game,
 too.
 
 So if you are interested: Atomorun2008.whosme.de
Sorry I just have to ask, you wouldn't also be the author of Dear Camy? The reason is the sound effects are a little similar.
Aug 21 2008
parent Matthias Thurau <Matthiasth gmx.de> writes:
Jesse Phillips Wrote:

 On Wed, 20 Aug 2008 12:49:36 -0400, Matthias Thurau wrote:
 
 Hello,
 
 As a Reminder: Atomorun2008 is a free 3D Jump n Run Game written in D.
 
 After a while and some feedback from some users in the last time, i
 decided to publish the sourcecode of Atomorun2008 under GPL. Frostwork
 aka Marcel Unbehaun released Linux and Mac OS X versions of the Game,
 too.
 
 So if you are interested: Atomorun2008.whosme.de
Sorry I just have to ask, you wouldn't also be the author of Dear Camy? The reason is the sound effects are a little similar.
No, not my game :)
Aug 22 2008
prev sibling parent reply Nicolay Korslund <korslund gmail.com> writes:
Well, I guess if you post a game on a programmers forum, you should expect
comments on code style ;-)

I thought the game was fun - I like the accelerated platform jumper idea,
requiring many leaps of faith as it goes faster :) There's a lot of things you
could add in of course, like obstacles / enemies, multiple platform heights,
etc to get more variety. But all in all a fun and simple game.
Aug 22 2008
parent Matthias Thurau <Matthiasth gmx.de> writes:
Nicolay Korslund Wrote:

 Well, I guess if you post a game on a programmers forum, you should expect
comments on code style ;-)
 
 I thought the game was fun - I like the accelerated platform jumper idea,
requiring many leaps of faith as it goes faster :) There's a lot of things you
could add in of course, like obstacles / enemies, multiple platform heights,
etc to get more variety. But all in all a fun and simple game.
Yeah, thats right :) I have a nice List of what is possible to do for Atomorun2009 :) Maybe i will. But i hadn t any motivation to work on this any more since a half year. No time etc. It was Marcel Unbehaun that thought about the Linux releases and he asked me to publish the source, too. So we did. I would prefer, when i have the time (next month) to make a tower defense game!
Aug 22 2008