Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gameboy platformer
#1
Because I don't have enough unfinished projects already ...



It is actually very fun to draw sprites and tiles using only four shades of green.
Reply
#2
Nicely done. Very retro... Does it come in blue? lol
Logic is the beginning of wisdom.
Reply
#3
(11-01-2025, 05:33 PM)johnno56 Wrote: Nicely done. Very retro... Does it come in blue? lol

Hi Johnno,

Try this code to turn green tone to blue tone color 
set color 0,255*(1-i)/(g-1),255*i/(g-1) 

And this code to turn greyscale color
c = 0.2126 * r+0.7152 * g+0.0722 * b
set color c,c,c

           
click each image to zoom-in

Code:
'==========
'Blue Tones
'==========

#win32
set window "Blue Tones", 800,440,false
set redraw off

'color definition
visible black   = [0,0,0]
visible white   = [255,255,255]

'image
donkey_kong = loadimage("assets/donkey kong.jpg")


'-----------
' MAIN LOOP
'-----------
while not keydown(KEY_ESCAPE,true)

    'clear screen
    set color black
    cls

    'draw image   
    set color white
    draw image donkey_kong,0,0   

    'operation : blue tone
    if keydown(KEY_1,true) then
        for x = 0 to width()-1
            for y = 0 to height()-1
           
                temp = pixel(x,y)
                r = temp[0]
                g = temp[1]
                b = temp[2]
                i = 50
               
                set color 0,255*(1-i)/(g-1),255*i/(g-1)
                set pixel x,y
            next
        next   
       
        'pause
        pause(black,1)
    endif

    'operation : greyscale
    if keydown(KEY_2,true) then
        for x = 0 to width()-1
            for y = 0 to height()-1
           
                temp = pixel(x,y)
                r = temp[0]
                g = temp[1]
                b = temp[2]
               
                c = 0.2126 * r+0.7152 * g+0.0722 * b
               
                set color c,c,c
                set pixel x,y
            next
        next   
       
        'pause
        pause(white,2)
    endif       
           
    infoBox(0)
   
    fwait 60
    redraw

wend


'-----------
' FUNCTIONS
'-----------
function pause(c,i)
    do
        set caret 10, 130
        set color white
        wln "Press SPACE BAR to continue"
        infoBox(i)
        fwait 60
        redraw
    until keydown(KEY_SPACE,true)
endfunc

function infoBox(i)
    select i
        case 0
            mode = "Normal"
        case 1
            mode = "Blue Tone"
        case 2
            mode = "Greyscale"
    endsel

    set caret 10,10
    wln "Info Box"
    wln "Color Mode = "+upper(mode)
    wln
    wln "Control Keys :"
    wln " Key 1    = Blue Tone"
    wln " Key 2    = Greyscale"
endfunc


Attached Files
.zip   BlueTone.zip (Size: 51.18 KB / Downloads: 4)
Reply
#4
Cool...
Logic is the beginning of wisdom.
Reply
#5
(11-03-2025, 05:35 AM)johnno56 Wrote: Cool...

UPDATE blue tone code to :
Code:
                c = 0.2126 * r+0.7152 * g+0.0722 * b
                set color 0,c,c

it gives you a better blue tone like this :

   
click image to zoom in
Reply
#6
Ah... Much better... Big Grin
Logic is the beginning of wisdom.
Reply
#7
I'll add some different "color" options when I upload the game. Makes me think of Super Gameboy that I had for SNES. With it, you could play gameboy games on your tv, and there were lots of palette options Smile
Reply
#8
I am curious as to the method or process that you used to make the game. i.e. The tools for sound and graphics (if not wanting to download assets). Planning of the layout and game-flow etc... You know... all the cool stuff that's done to make a cool game... I wonder if these kind of questions could possibly evolve into say... a Tutorials or even a GameDev sub-forum? Moo Ha Ha Ha....
Logic is the beginning of wisdom.
Reply
#9
(11-05-2025, 10:19 AM)johnno56 Wrote: I am curious as to the method or process that you used to make the game. i.e. The tools for sound and graphics (if not wanting to download assets). Planning of the layout and game-flow etc... You know... all the cool stuff that's done to make a cool game... I wonder if these kind of questions could possibly evolve into say... a Tutorials or even a GameDev sub-forum? Moo Ha Ha Ha....


I can atleast tell you what I use Smile  I use n7's sfx library to create sound effects and (paid) AI for the music. For graphics I use the gimp. But I don't ... "plan" much when I make a game like this, because I've made like a billion similar platform games prior to this one. I rarely re-use code though. For this game I could have used lots of stuff from the "Bulb Boy" example game or from that Christmas platformer I made last year, but ... I don't. Instead I re-invent the wheel every time.

There has been no level design involved so far. I always start off with a quickly made map (tilemap editor) and draw and write the code for all enemies and logic needed for the entire game. I mash everything into the test map, and when all works fine I start making real levels. And that is EXACTLY when I usually give up on a project, because I HATE, HATE, HATE to design levels! Just look at "Robowack 3"! Writing all the game logic, making everything I wanted possible, was super fun. But continuing with another level after the first test level? No way, boring as hell!

I've attached a version of the game here, not too much code. Beside the two enemies you saw in the video, I've added three lift types.

I wish I was good at making tutorials. But I truely suck at it Sad  Maybe I should live-stream some game development instead, haha Smile


Attached Files
.zip   gb_pf.zip (Size: 1.29 MB / Downloads: 7)
Reply
#10
Ha! Sound effects library! Completely forgot about 'that' one... But, then again, I am exceptionally good at that... forgetting... lol
Music: Not a fan of today's "Doof-doof" music. I particularly like the old 8 bit game tracks. So retro...
Gimp. My 'go to' gfx editor. My largest project was creating a planet... If I can find it, I will post it...
Re-invent the wheel: Almost my middle name...
Giving up: Unfortunately, that is something that I do far too often! Almost a Pro... usually 'before' creating the first level... So many unfinished projects... *sigh*

Thanks for file... I'm going to go over it with a fine-toothed comb... More brain food... Imagination and creativity are what I lack the most...

Found it....

   

It was the result of a multi-part tutorial... Overall, it took about an hour to make... That was reading and doing and reading... I suppose it could be shortened with practice...
Logic is the beginning of wisdom.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)