Gizmo's Adventure Code Review

Started by
1 comment, last by Altourus 13 years, 5 months ago
Hey just finished up my first game for NDS homebrew. Its a pretty standard platformer and you can see a preview
">here

Controls
----------
Left or Right arrows to move
Hold X to run
Press A to jump

To download the game or Source code go here

Looking forward to hearing some of your opinions on improvements I can make to the code.
Advertisement
Hello,
Nice game...

A comment about the source code:
I see you use alot of pass-by-const-value in your functions like,

void LoadTiles(const int x, const int y);

There's no need to make them const since they are going to be copied. If you were passing complex objects, like class instances, then you should make them references to const if they are not going to be changed within the function.
So for example:
void LoadTiles( const TileInfo &tileInfo );

But it's good you are trying to make the code const-correct. That is good C++ style.

Quote:Original post by gtdelarosa2
Hello,
Nice game...

A comment about the source code:
I see you use alot of pass-by-const-value in your functions like,

void LoadTiles(const int x, const int y);

There's no need to make them const since they are going to be copied. If you were passing complex objects, like class instances, then you should make them references to const if they are not going to be changed within the function.
So for example:
void LoadTiles( const TileInfo &tileInfo );

But it's good you are trying to make the code const-correct. That is good C++ style.


Thanks, I'll keep that in mind :)

Edit: Updated the source code to reflect the changes you suggested

This topic is closed to new replies.

Advertisement