S-COPTER, a Choplifter - Like

Advice on general approaches or feasibility and discussions about game design

S-COPTER, a Choplifter - Like

Postby clement » Sat Jan 03, 2015 5:50 pm

Hi,

I ve commit lastest change of S-COPTER

Image


The code is on GitHub : https://github.com/Clement83/Copter


enjoy :)


----- last post ---
Hello,

I begin a choplifter-like

some screen-shot :

Image
Image

The code is on GitHub : https://github.com/Clement83/Copter

enjoy :)
Last edited by clement on Wed Apr 08, 2015 7:20 pm, edited 2 times in total.
clement
 
Posts: 161
Joined: Sat Oct 25, 2014 8:06 am

Re: Choplifter - Like

Postby 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

Re: Choplifter - Like

Postby clement » Sun Jan 18, 2015 10:34 pm

I change the style of game !

Now is modern warface choplifter ;)

Image
clement
 
Posts: 161
Joined: Sat Oct 25, 2014 8:06 am

Re: Choplifter - Like

Postby 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?
User avatar
frakasss
 
Posts: 97
Joined: Thu Dec 11, 2014 10:20 am
Location: France

Re: Choplifter - Like

Postby 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 !
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: Choplifter - Like

Postby clement » Tue Jan 20, 2015 6:51 pm

Thank for your Advice frakasss and jonnection. :D
clement
 
Posts: 161
Joined: Sat Oct 25, 2014 8:06 am

Re: Choplifter - Like

Postby clement » Sat Jan 31, 2015 8:03 pm

Hi,

I'v work on the game :

Image

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/Copter

todo :
  • 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

Re: S-COPTER, a Choplifter - Like

Postby 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

Re: S-COPTER, a Choplifter - Like

Postby 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-operator

Bitwise 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 / 8

is the same as

i>>3

Again, it might be that the compiler does this correctly, but it is fun to know about these small tricks !

Keep on coding, looking good !
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: S-COPTER, a Choplifter - Like

Postby 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

Next

Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 24 guests

cron