Advice on general approaches or feasibility and discussions about game design
by honolulu » Sat Jan 03, 2015 8:17 pm
Excellent !!
Great Idea !! Love this game.
-
honolulu
-
- Posts: 33
- Joined: Thu Oct 09, 2014 2:50 pm
by clement » Sun Jan 18, 2015 10:34 pm
I change the style of game !
Now is modern warface choplifter
-
clement
-
- Posts: 161
- Joined: Sat Oct 25, 2014 8:06 am
by frakasss » Mon Jan 19, 2015 10:22 am
Looks great!!
Would be good to have the 'landscape' in grey instead of black?
Else, it will be difficult to differentiate 'obstacles' and 'landscape', don't you think so?
-
frakasss
-
- Posts: 97
- Joined: Thu Dec 11, 2014 10:20 am
- Location: France
by jonnection » Mon Jan 19, 2015 8:45 pm
Looks awesome! Choplifter is one of my all time favourite games.
2 ideas for you:
1) in your drawBitmapAngle, you are calculating sin(angle) and cos(angle) in every loop of your bitmap code (inside the for (i = 0; i < w; i++) { loop)
You can calculate the sin(angle) and cos(angle) only once at the beginning of the routine and store them in variables (calculer seulement une fois au debut de la routine). Then you can use those values inside the loop. That way you can save a lot of processor cycles.
2) draw another helicopter bitmap where you have the whole helicopter including windows in black (tous pixels noire, et aussi les fenetres)
then you can change the bitmap code to:
void drawBitmapAngle(int8_t x, int8_t y, const uint8_t *bitmap, const uint8_t *mask, float angle)
...
// read from mask if pixel should be drawn
if (pgm_read_byte(mask + j * byteWidth + i / 8) & (B10000000 >> (i % 8))) {
// determine colour of pixel from bitmap (black = body of chopper, white = window)
gb.display.setColor(pgm_read_byte(bitmap + j * byteWidth + i / 8) & (B10000000 >> (i % 8))); // ... or something like this
gb.display.drawPixel(x + desX, y + desY);
In this way, you can have a masked bitmap of your chopper == it will stand out from the background !
Happy coding !
-
jonnection
-
- Posts: 317
- Joined: Sun May 04, 2014 8:21 pm
-
by clement » Tue Jan 20, 2015 6:51 pm
Thank for your Advice frakasss and jonnection.
-
clement
-
- Posts: 161
- Joined: Sat Oct 25, 2014 8:06 am
by clement » Sat Jan 31, 2015 8:03 pm
Hi,
I'v work on the game :
Change log :
- Core game optimisation (thank jon)
- Take prisoner in chopper
- Save it on base camp
- Kill ennemies, and prisoner
- Ennemies can kill you
- new ennemie
I'v update Git hub repository, in the .zip you can get the S-COPTER.HEX for test it :
https://github.com/Clement83/Coptertodo :
- IA
- Start/win/die screen
- Rocket luncher
- Prisoners are in jail and you need to break it to save them
- improved graphics and readability
- OverCharge getline
- chopper Life in HUD
-
clement
-
- Posts: 161
- Joined: Sat Oct 25, 2014 8:06 am
by clement » Wed Apr 08, 2015 7:27 pm
last update :
change log :
- die screen
- improved graphics and readability
- OverCharge getline
- chopper Life in HUD
- the game is more difficult
- restore life COD 'style
todo :
- IA
- Start/win
- Rocket luncher
- Prisoners are in jail and you need to break it to save them
-
clement
-
- Posts: 161
- Joined: Sat Oct 25, 2014 8:06 am
by jonnection » Wed Apr 08, 2015 8:16 pm
Starting to look very nice Clement !
I also checked out your code for drawing the helicopter. It is much better optimized now, and looks better too.
One more thing:
you can replace the modulus operator (%) with a bitwise modulo in line
- Code: Select all
if (pgm_read_byte(mask + j * byteWidth + i / 8) & (B10000000 >> (i % 8)))
Because in powers of 2,
i%8 is the same thing as
i&7. So you can write it as:
- Code: Select all
if (pgm_read_byte(mask + j * byteWidth + i / 8) & (B10000000 >> (i & 7)))
http://stackoverflow.com/questions/3072665/bitwise-and-in-place-of-modulus-operatorBitwise modulo is should be faster than the modulus operator (%), although mayber the compiler optimizes correctly.
Also, in powers of 2, division by numbers that are 2^n can be replaced by bitshifts, so:
i / 8is the same as
i>>3Again, it might be that the compiler does this correctly, but it is fun to know about these small tricks !
Keep on coding, looking good !
-
jonnection
-
- Posts: 317
- Joined: Sun May 04, 2014 8:21 pm
-
by clement » Mon Apr 13, 2015 6:20 pm
thx for your advice jonne!
I change it in the future version.
-
clement
-
- Posts: 161
- Joined: Sat Oct 25, 2014 8:06 am
Return to Project Guidance & Game development
Who is online
Users browsing this forum: No registered users and 6 guests