This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include once "fbgfx.bi" | |
#define FBEXT_NoBuiltinInstanciations() 1 | |
#define FBEXT_NO_EXTERNAL_LIBS () -1 | |
#include once "ext/graphics/sprite.bi" | |
#include once "ext/graphics/manip.bi" | |
#include once "ext/graphics/bmp.bi" | |
#include once "ext/graphics/colors.bi" | |
using ext | |
using fb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
screenres 640,480,32 | |
'magic numbers | |
const frog_speed as integer = 32 | |
const car_log_sp as integer = 2 | |
'toggle between east and west directions | |
#define dtoggle(d) ((d) xor 2 ) | |
enum direction explicit | |
north =0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dim frog as gfx.sprite | |
dim frog_dir as integer | |
dim car(1 to 4) as gfx.sprite ptr | |
dim car_dir(1 to 4) as integer | |
dim logs(1 to 4) as gfx.sprite ptr | |
dim logs_dir(1 to 4) as integer | |
dim pads(1 to 5) as gfx.sprite ptr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls | |
'create a frog image | |
var iFrog = gfx.bmp.load("frog.bmp") | |
frog.init(6) | |
frog.SetImage(direction.north, iFrog) | |
frog.RotateFrom(direction.north, direction.east, -90) | |
frog.RotateFrom(direction.north, direction.south, 180) | |
frog.RotateFrom(direction.north, direction.west, 90) | |
frog.SetImage(FROG_DEAD, gfx.grayscale(iFrog)) | |
frog.DuplicateImage(direction.north, FROG_WIN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iCar = gfx.bmp.load("beetle.bmp") | |
car(1) = new gfx.sprite(4) | |
car(1)->SetImage(direction.east, iCar) | |
car(1)->SetImage(direction.west, gfx.flipHorizontal( iCar )) | |
for l as integer = 2 to 4 | |
car(l) = new gfx.sprite(*(car(1))) 'just a 1 to 1 copy of the car | |
next | |
'What rolls down stairs | |
'alone or in pairs | |
'rolls over your neighbor's dog? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'draw background | |
line (0,0)-(640,480),gfx.colors.orange,bf 'orange display area | |
line (0,32)-(372,62),gfx.colors.blue,bf 'brown-ish home | |
line (0,63)-(372,191),gfx.colors.blue,bf 'blue river | |
line (0,192)-(372,223),gfx.colors.forest_green,bf 'green safe spot | |
line (0,224)-(372,351),gfx.colors.grey,bf 'grey road | |
line (0,352)-(372,383),gfx.colors.forest_green,bf 'green start | |
line (0,384)-(372,415),gfx.colors.orange,bf 'orange display area | |
'lines on road | |
line (0,256)-(372,256),gfx.colors.yellow 'yellow lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reply = "" 'will hold the player's response to keep playing or quit | |
'set lily pad positions, only ever needs to be done once | |
for i as integer = 1 to 5 | |
pads(i)->position((i-1)*81,35) | |
next i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
reply = "" 'signal to keep going while reply <> "y" or "x" | |
frog.position( 170, 357 ) | |
frog_dir = direction.north | |
car(1)->position( 0, 230 ) | |
car_dir(1) = direction.east | |
car(2)->position( 300, 262 ) | |
car_dir(2) = direction.east | |
car(3)->position( 150, 294 ) | |
car_dir(3) = direction.east |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
'used for location testing later | |
var temp_cx = -1f | |
var temp_cy = -1f | |
screenlock() | |
'cls | |
'draw background | |
put (0,0),backGround,pset | |
for i as integer = 1 to 5 | |
pads(i)->DrawImage 0, , gfx.trans_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if frog_dir < FROG_DEAD then | |
'update car positions | |
for i as integer = 1 to 4 | |
select case car_dir(i) | |
case direction.east | |
car(i)->update( car_log_sp, 0 ) | |
case direction.west | |
car(i)->update( -(car_log_sp), 0 ) | |
end select | |
next i |
OlderNewer