Sprite questions

Understanding the language, error messages, etc.

Re: Sprite questions

Postby Drakker » Wed May 21, 2014 12:00 am

Considering that transparent would be white and opaque would be black on the LCD, that works nicely if you want transparent pixels, but if you want a pixel to be white (0, transparent) no matter what when the background might already be black or gray?

Would it be possible to do something like this:

(W = white, B = black)
W B
0 0 = transparent pixel
1 0 = white
0 1 = black
1 1 = gray

This way you'd have an array for white, an array for black, and when a pixel is in both arrays, it would result in a gray pixel. Or am I missing something?

I was putting that idea forward simply because that's how it's done on older systems, say, the NES.
User avatar
Drakker
 
Posts: 297
Joined: Sun Mar 30, 2014 2:54 am
Location: Québec, Canada

Re: Sprite questions

Postby adekto » Thu May 29, 2014 3:35 pm

hey guys just wonderign what code u guys use for the grey
maybe its just be but it just looks like its flickering to slow/fast that i just see mostly black
Code: Select all
 if(gb.frameCount%2) gb.display.drawBitmap(enemy_x,enemy_y,batG,0,NOFLIP);
    else {
      gb.display.setColor(WHITE);
      gb.display.drawBitmap(enemy_x,enemy_y,batG,0,NOFLIP);
    }
    gb.display.setColor(BLACK);
    gb.display.drawBitmap(enemy_x,enemy_y,batB,0,NOFLIP);
User avatar
adekto
 
Posts: 448
Joined: Tue Feb 25, 2014 9:47 pm
Location: belgium

Re: Sprite questions

Postby rodot » Thu May 29, 2014 3:39 pm

You should load SETTINGS.HEX from your SD to adjust the contrasts.
Also, set the frame rate at 41 using gb.setFrameRate(41);
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Previous

Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 12 guests

cron