Roll out the barrel

Game development specific discussions.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Roll out the barrel

Post by BasicCoder2 »

Run this to create the bitmaps used in the program.

Code: Select all

const SCRW = 480
const SCRH = 480

screenres SCRW,SCRH,32
color rgb(0,0,0),rgb(200,200,255)

dim shared as any ptr sTile
sTile = imagecreate(16,16)
dim shared as any ptr LTile
LTile = imagecreate(16,16)
dim shared as any ptr scaffolding
scaffolding = imagecreate(SCRW,SCRH,rgb(255,0,255))
dim shared as any ptr ladders
ladders = imagecreate(SCRW,SCRH,rgb(255,0,255))
dim shared as any ptr barrels
barrels = imagecreate(304,19,rgb(255,0,255))


'================================================
'===========  CREATE SCAFFOLDING TILE ===========
'================================================


dim as ulong v
for j as integer = 0 to 15
    for i as integer = 0 to 15
        read v
        if v = 0 then pset sTile,(i,j),rgb(200,200,255)
        if v = 1 then pset sTile,(i,j),rgb(136,0,21)
        if v = 2 then pset sTile,(i,j),rgb(255,127,39)
        if v = 3 then pset sTile,(i,j),rgb(185,122,87)
    next i
next j

bsave "sTile.bmp",sTile

'====================================================
'   DRAW SCAFFOLDING TILES INTO slopes bitmap
'====================================================
dim as integer j

j = 160
for i as integer = 0 to 26 step 2
    put scaffolding,(i*16,j),sTile,trans
    put scaffolding,(i*16+16,j),sTile,trans
    if i > 16 then
        j = j + 2
    end if
next i
j = j + 32
for i as integer = 26 to 0 step -2
    put scaffolding,(i*16+32,j),sTile,trans
    put scaffolding,(i*16++32+16,j),sTile,trans
    j = j + 2
next i
j = j + 32
for i as integer = 0 to 26 step 2
    put scaffolding,(i*16,j),sTile,trans
    put scaffolding,(i*16+16,j),sTile,trans
    j = j + 2
next i
j = j + 32
for i as integer = 26 to 0 step -2
    put scaffolding,(i*16+32,j),sTile,trans
    put scaffolding,(i*16++32+16,j),sTile,trans
    j = j + 2
next i
j = j + 32
for i as integer = 0 to 26 step 2
    put scaffolding,(i*16,j),sTile,trans
    put scaffolding,(i*16+16,j),sTile,trans
    j = j + 2
next i
j = j + 32
for i as integer = 28 to 0 step -2
    put scaffolding,(i*16,j),sTile,trans
    put scaffolding,(i*16+16,j),sTile,trans
    if i > 16 then
        j = j + 2
    end if
next i

bsave "scaffolding.bmp",scaffolding

'===========================================
'===========  CREATE LADDER TILE ===========
'===========================================

'bload "sTile.bmp",LTile
for j as integer = 0 to 15
    for i as integer = 0 to 15
        read v
        if v = 0 then pset LTile,(i,j),rgb(200,200,255)
        if v = 1 then pset LTile,(i,j),rgb(55,55,255)
    next i
next j
bsave "LTile.bmp",LTile

'====================================================
'   DRAW LADDERS INTO LADDER BITMAP
'====================================================
sub drawLadder(x as integer,y as integer)
    put ladders,(x,y),LTile,trans
    put ladders,(x,y+16),LTile,trans
    put ladders,(x,y+32),LTile,trans
    put ladders,(x,y+48),LTile,trans
end sub
sub drawLadder3(x as integer,y as integer)
    put ladders,(x,y),LTile,trans
    put ladders,(x,y+16),LTile,trans
    put ladders,(x,y+32),LTile,trans
end sub

drawLadder(112,160)
drawLadder(257,214)
drawLadder(208,274)
drawLadder(257,334)
drawLadder(144,390)

drawLadder3(336,162)
drawLadder3(128,222)
drawLadder3(336,282)
drawLadder3(128,342)
drawLadder3(336,402)

bsave "ladders.bmp",ladders


'===========  create barrels image sprite sheet   =================
Const Pi = 4 * Atn(1)
Dim Shared As Double TwoPi = 8 * Atn(1)
Dim Shared As Double RtoD = 180 / Pi   ' radians * RtoD = degrees
Dim Shared As Double DtoR = Pi / 180   ' degrees * DtoR = radians

dim as single angle,dx,dy,px,py
px = 9
py = 9
dim as single i

for angle as single = 0 to 359 step 360/16
    circle barrels,(px+i*19,py),9,rgb(100,100,255),,,,f
    dx = cos(angle*DtoR)*8
    dy = sin(angle*DtoR)*8
    line barrels,(px+i*19,py)-(px+dx+i*19,py+dy),rgb(0,0,0)
    line barrels,(px+i*19,py)-(px-dx+i*19,py-dy),rgb(0,0,0)
    dx = cos((angle+90)*DtoR)*5
    dy = sin((angle+90)*DtoR)*5
    circle barrels,(px+dx+i*19,py+dy),2,rgb(255,0,0),,,,f
    circle barrels,(px+i*19,py),9,rgb(0,0,0)
    i = i + 1
next angle
bsave "barrels.bmp",barrels
put (0,0),barrels,trans
sleep

screenres 640,480,32
color rgb(0,0,0),rgb(255,255,255):cls
dim as any ptr image
image = imagecreate( 100, 168)
dim as ulong colors( 17)
colors( 0)=RGB(255,0,255)
colors( 1)=RGB(0,0,0)
colors( 2)=RGB(128,0,0)
colors( 3)=RGB(240,207,164)
colors( 4)=RGB(64,32,0)
colors( 5)=RGB(237,28,36)
colors( 6)=RGB(255,127,39)
colors( 7)=RGB(24,126,55)
colors( 8)=RGB(34,177,76)
colors( 9)=RGB(136,0,21)
colors( 10)=RGB(156,22,46)
colors( 11)=RGB(224,192,128)
colors( 12)=RGB(224,128,64)
colors( 13)=RGB(224,224,128)
colors( 14)=RGB(32,192,64)
colors( 15)=RGB(64,32,64)
colors( 16)=RGB(224,128,0)
    dim as integer n
    for j as integer = 0 to  167
        for i as integer = 0 to  99
            read n
            pset image,(i,j),colors(n)
        next i
    next j
bsave "smallGuy2A.bmp",image

'sTile
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3
data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3
data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3
data 1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,1
data 0,0,0,0,1,2,2,2,2,2,2,1,0,0,0,0
data 0,0,0,1,2,2,2,1,1,2,2,2,1,0,0,0
data 0,0,1,2,2,2,1,0,0,1,2,2,2,1,0,0
data 0,1,2,2,2,1,0,0,0,0,1,2,2,2,1,0
data 1,2,2,2,1,0,0,0,0,0,0,1,2,2,2,3
data 2,2,2,1,0,0,0,0,0,0,0,0,1,2,2,3
data 2,2,2,1,0,0,0,0,0,0,0,0,1,2,2,3
data 2,2,2,1,1,1,1,1,1,1,1,1,1,2,2,3
data 2,2,2,2,2,2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14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,7,7,1,14,14,14,14,14,14,15,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,14,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,1,7,7,7,7,7,15,0,0,0,0,0,0
DATA  0,0,0,0,0,0,1,7,7,7,1,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,7,1,1,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,14,1,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,1,7,7,7,7,1,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,1,7,7,7,7,1,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,1,1,2,1,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,14,1,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,1,7,7,7,1,0,0,0,0,0,0,0,0
DATA  0,0,0,0,0,1,7,7,7,7,7,7,1,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,1,2,2,2,1,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,14,1,7,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,1,1,7,1,0,0,0,0,0,0,0,0,0
DATA  0,0,1,1,1,7,7,7,7,7,7,7,1,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,1,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,14,14,14,14,14,14,14,1,7,7,7,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,1,2,1,0,0,0,0,0,0,0,0,0,0
DATA  0,1,2,2,1,7,7,7,7,7,1,1,0,1,14,14,14,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1,1,1,1,14,14,14,14,14,14,14,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,14,14,14,1,3,3,1,7,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,1,1,0,1,1,1,0,0,0
DATA  0,0,0,0,0,0,1,7,7,7,7,1,1,1,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,1,1,1,7,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,1,1,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,1,7,7,7,7,7,1,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,14,14,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,1,7,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,14,1,1,1,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,1,7,7,7,7,1,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,1,14,14,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,1,1,7,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,1,7,7,7,1,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,0,1,7,7,7,1,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,7,1,14,14,14,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,1,2,1,1,7,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,14,14,14,14,1,7,7,7,7,1,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,0,0,1,7,1,1,14,14,14,14,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,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0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0
This is the demo code.

Code: Select all

const SCRW = 480
const SCRH = 480

screenres SCRW,SCRH,32
color rgb(0,0,0),rgb(200,200,255)

dim shared as any ptr scaffolding
scaffolding = imagecreate(SCRW,SCRH,rgb(255,0,255))
bload "scaffolding.bmp",scaffolding

dim shared as any ptr ladders
ladders = imagecreate(SCRW,SCRH,rgb(255,0,255))
bload "ladders.bmp",ladders

dim as any ptr spriteSheet2
spriteSheet2 = imagecreate(100,168,rgb(255,0,255))
bload "smallGuy2A.bmp",spriteSheet2

'=====================================

type SPRITE
    as integer px
    as integer py
    as integer vx
    as integer vy
    as integer w
    as integer h
    as integer a      'alive
    as integer s      'which image strip to use
    as integer f      'current frame
    as integer fc     'number of frames
    as integer c      'count between frames
    as any ptr img    'pointer to sprite sheet
end type


dim shared as SPRITE hero
hero.px = 72
hero.py = 400
hero.w  = 25
hero.h  = 42
hero.s  = 1    'walking right
hero.fc = 4
hero.img = spriteSheet2
hero.a   = 1   'show hero

dim shared as SPRITE barrel(0 to 19)  'up to 20 barrels
dim shared as integer total      'total barrels

dim shared as any ptr barrels
barrels = imagecreate(304,19,rgb(255,0,255))
bload "barrels.bmp",barrels

'==============================================

sub throwBarrel()

    if total < 19 then
        barrel(total).a  = 1    'show ball
        barrel(total).fc = 16
        barrel(total).px = 122
        barrel(total).py = 144
        barrel(total).vx = 1
        barrel(total).vy = 1   'gravity
        barrel(total).w  = 19
        barrel(total).h  = 19
        barrel(total).img = barrels
        total = total + 1
    end if
    
end sub

function testCollision(b1 as SPRITE,b2 as SPRITE) as boolean
    return b2.py < b1.py+b1.h and b2.py+b2.h > b1.py and b2.px < b1.px+b1.w and b2.px+b2.w > b1.px
end function

function onGround(b as SPRITE) as boolean
    if point (b.px+b.w\2 ,b.py+b.h-1,scaffolding)<>rgb(255,0,255) then
        return TRUE
    else
        return FALSE
    end if
end function

function onLadder(b as SPRITE) as boolean
    if point(b.px+ b.w\2,b.py+b.h-1,ladders)<>rgb(255,0,255) or point(b.px+ b.w\2,b.py+b.h,ladders)<>rgb(255,0,255) then
        return TRUE
    else
        return FALSE
    end if
end function

sub display()
    screenlock
    cls
    put (0,0),scaffolding,trans
    put (0,0),ladders,trans   'show ladders
    
    'draw any barrels
    if total > 0 then
        for i as integer = 0 to total-1
            if barrel(i).a = 1 then
                put (barrel(i).px,barrel(i).py),barrels,(barrel(i).f*19,0)-(barrel(i).f*19+18,18),trans
            end if
        next i
    end if    
    
    'draw hero if alive
    if hero.a = 1 then
        put (hero.px,hero.py),hero.img,(hero.f*hero.w,hero.s*hero.h)-(hero.f*hero.w + hero.w-1,hero.s * hero.h + hero.h-1),trans
    end if
    
    locate 2,2
    print " TAP SPACE BAR TO ROLL A BARREL"
    
    screenunlock
end sub

sub update()

    hero.c = hero.c + 1
    if hero.c > 10 then      'controls frame rate
        hero.c = 0           'reset counter
        hero.f = hero.f + 1  'next frame
        if hero.f = hero.fc then
            hero.f = 0
        end if
    end if
    
    if total > 0 then
        for i as integer = 0 to total-1

            barrel(i).c = barrel(i).c + 1
            if barrel(i).c > 4 then
                barrel(i).c = 0
                if barrel(i).vx > 0 then
                    barrel(i).f = barrel(i).f + 1
                    if barrel(i).f = barrel(i).fc then barrel(i).f = 0
                else
                    barrel(i).f = barrel(i).f - 1
                    if barrel(i).f < 0 then barrel(i).f = barrel(i).fc-1
                end if
            end if

            'update position
            barrel(i).px = barrel(i).px + barrel(i).vx  'move barrel left/right
            
            if not(onGround(barrel(i))) then
               barrel(i).py = barrel(i).py + 1  'gravity
            end if
            if onGround(barrel(i)) then
                barrel(i).py = barrel(i).py - 1
            end if

            'change horizontal direction
            if barrel(i).px < 0 or barrel(i).px > SCRW-19 then
                barrel(i).vx = -barrel(i).vx
                barrel(i).f = 0
            end if
            
            'remove hero if collision with a barrel
            if testCollision(hero,barrel(i)) = TRUE then
                hero.a = 0   'end of hero
            end if
            
            'remove barrel at end of run
            if barrel(i).py = 435 and barrel(i).px = 10  then
                barrel(i).a = 0
            end if
            
        next i
    end if

    if not(onLadder(hero)) then
        if not(onGround(hero)) then
            hero.py = hero.py + 1  'gravity
        end if
        while onGround(hero)
            hero.py = hero.py - 1  'lift out of ground
        wend
    end if
    

end sub

do
    display()
    
    if inkey=" " then
        throwBarrel()
    end if
    
    hero.s = 0   'not moving
    
    if multikey(&H4B) then
        hero.px = hero.px - 1
        hero.s  = 2                  'move left
    end if
    if multikey(&H4D) then
        hero.px = hero.px + 1
        hero.s  = 1                  'move right
    end if
    
    if onLadder(hero) then
        if multikey(&H48) then  'UP
            hero.py = hero.py - 1
            hero.s  = 3
        end if
    
        if multikey(&H50) then  'DOWN
            hero.py = hero.py + 1
            hero.s  = 3
        end if
    end if
    
    'adjust for left/right border
    if hero.px < 0 then hero.px = 0
    if hero.px > SCRW - hero.w then hero.px = SCRW - hero.w

    
    update()
    sleep 10
loop until multikey(&H01)
Last edited by BasicCoder2 on Jun 03, 2018 18:02, edited 7 times in total.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Roll out the barrel

Post by jj2007 »

It builds fine but tapping space doesn't do anything. Win7-64 here...
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Roll out the barrel

Post by BasicCoder2 »

@jj2007,
Sorry forgot about the barrels.bmp image.

edit: First post now has new code to create bitmaps so no bitmaps download required.
Last edited by BasicCoder2 on Jun 03, 2018 21:02, edited 3 times in total.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Roll out the barrel

Post by jj2007 »

Works great now, compliments!
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Roll out the barrel

Post by lizard »

Works here on Linux 64. Fascinating with such few lines to realize this game. There is not much left to make i complete. Player sprite and goal to reach. And then next level. And next. And dozens more...

Then you could do a "Loderunner", too. Played this some time. Or "Castles of Dr. Creep". These were goodies on C64.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Roll out the barrel

Post by BasicCoder2 »

lizard wrote: Fascinating with such few lines to realize this game.
It can be reduced further by loading the images rather than generating them from data statements.
edit:
I have now separated the bitmap creation code and demo code in the first post.
Last edited by BasicCoder2 on Jun 03, 2018 10:12, edited 3 times in total.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Roll out the barrel

Post by dodicat »

Hi Basiccoder2
I have the whole game except the barral image.
I have an image OK, but it is a white square.
Problem is:
Win 10 no longer has paint, but paint 3d.
I cannot seem to save your bitmap the old way, I get a white image instead via bload.
I see the image OK if I click on it (opens with photo)
I shall investigate further.
But the game looks good even with a white box (sliding)
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Roll out the barrel

Post by badidea »

Nice, I made the ladders transparent, but then it became difficult to climb/descent ladders. I wouldn't use point(..) the determine the sprite.
Image
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Roll out the barrel

Post by BasicCoder2 »

@dodicat,
For some reason I have Paint and Paint3D on my new Windows10 laptop. I just checked and Paint3D can load the barrels.png file and saveAs a barrel.bmp file.

Run the second version I sent in the post above yours as it generates the barrels.bmp image itself and doesn't require the barrels.bmp to be loaded.

The rolling barrels is the best bit :)
Last edited by BasicCoder2 on Jun 01, 2018 18:04, edited 5 times in total.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Roll out the barrel

Post by BasicCoder2 »

@badidea,
The reason the ladders were not transparent is because I use a pixel hot spot and it wouldn't detect the ladder area if over a clear bit. I had thought of making the bit between the rungs the same colour as the background so they looked clear. I detect a collision between a hot spot and a clear area if it doesn't return rgb(255,0,255). I use hot spots all the time like touch buttons on a robot to detect sprite/background collisions although from memory I think the point command is slow.

By the way the gorilla doesn't roll barrels that close together!
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Roll out the barrel

Post by BasicCoder2 »

lizard wrote:... you could do a "Loderunner", too. Played this some time. Or "Castles of Dr. Creep". These were goodies on C64.
Well for copywrite reasons I wouldn't want to do a clone of anything. It was the behavior of such games that I was trying to code as a challenge. I would want to make up another retro game that used the game mechanics.
Last edited by BasicCoder2 on Jun 06, 2018 8:03, edited 1 time in total.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Roll out the barrel

Post by lizard »

Dr.Creep has been rewritten several times i believe:

https://www.google.de/search?q=castles+ ... 80&bih=825

Remembering i solved all levels, and they are huge. Both single and two-player modes with two joysticks. There we had to do clever teamwork. The whole game is very clever made.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Roll out the barrel

Post by lizard »

From all the thousands games i tried, i played very few to the end. Another was "Populus". Simply amazing. And some early of the C & C series like "Red Alert". Sadly some became annoying at the end.

Last years i lost interest for gaming. Dont know why. One gets enough from everything one day, i believe.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Roll out the barrel

Post by dodicat »

Thanks basiccoder2.
very nice work.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Roll out the barrel -- UPDATE

Post by BasicCoder2 »

Due to the positive feedback I have redone the code. See first post in this thread.
The hero sprite will vanish if hit by a barrel.
Of course I could keep improving the code with more animations to do things like jump the barrels. However I don't really want to duplicate the actual Donkey Kong game so it would be a case of coming up with another story.
Post Reply