Frogger revisited
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
I am glad that you like it. The background tune should come soon.
Last edited by Roland Chastain on Jun 21, 2012 16:23, edited 1 time in total.
Re: Frogger revisited
awe man... why didn't you use the latest one when you added sound? :(
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
It isn't too late. :-)Dr_D wrote:awe man... why didn't you use the latest one when you added sound? :(
I've just tried your version. The frog moves are very well done. But instead of cars and crocs, there are still rectangles.
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
Last edited by Roland Chastain on Apr 21, 2018 15:47, edited 2 times in total.
Re: Frogger revisited
hehehe, Cool man. Are you going to make a complete game now?
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
For me, I like it as it is. Maybe I will make some small corrections, but nothing else. If you have ideas to continue the project, please don't hesitate. You can start from this package if you want.Dr_D wrote:hehehe, Cool man. Are you going to make a complete game now?
Re: Frogger revisited
Beautiful.
1) Is not enough scoring.
2)The velocity can be increased with each passage to make it more difficult.
But maybe I should for nothing write because you have decided that the game you are satisfied :)
Anyway, well done Roland!
1) Is not enough scoring.
2)The velocity can be increased with each passage to make it more difficult.
But maybe I should for nothing write because you have decided that the game you are satisfied :)
Anyway, well done Roland!
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
Thank you, Vanya. The most part was made by others : I only stuck the pieces and tried to make a clean package. It's a team project, which has started one year ago with a code example written by BasicCoder2.
Re: Frogger revisited
I played the version on the FreeBASIC Games Directory, but the frog often refuses to respond to my keyboard commands. I'm using Windows 7..
Re: Frogger revisited
I had a similar problem when testing my game project Brick Mayhem on a Win7 computer. I could not navigate the main menu when in full screen. Maybe a GfxLib problem on Win7?agamemnus wrote:I played the version on the FreeBASIC Games Directory, but the frog often refuses to respond to my keyboard commands. I'm using Windows 7..
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
Hello gentlemen !
Here is a new Frogger edition.
I made small modifications here and there, but the most important is that the program now uses FBSound.
Here is a new Frogger edition.
I made small modifications here and there, but the most important is that the program now uses FBSound.
Last edited by Roland Chastain on Apr 22, 2018 7:34, edited 2 times in total.
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: Frogger revisited
I did start making better graphics then I lost momentum on the project :) One fix is that the sprites should exit and enter the screen not just turn around. I discovered that FreeBasic's graphics can handle images with coordinates outside the screen coordinates. Below is a demo but apart from the turtle I haven't had time to convert all the graphics to data statements so all you see are turtles.Roland Chastain wrote:Hello gentlemen !
Here is a new Frogger
I made small modifications here and there, but the most important is that the program now uses FBSound.
Run this to make a crude background image.
Code: Select all
'color used by MSPaint
const cOrange = rgb(255,127,39)
const cYellow = rgb(255,242,0)
const cLime = rgb(181,230,29)
const cBlue = rgb(0,162,232)
const cLightBlue = rgb(153,217,234)
const cDarkGreen = rgb(34,177,76)
const cRed = rgb(237,28,36)
const cLightGray = rgb(195,195,195)
screenres 640,480,32
'display text ribbon
line (0,0)-(639,40),cOrange,bf
line (0,41)-(639,80),cDarkGreen,bf
line (0,81)-(639,240),cLightBlue,bf
line (0,241)-(639,280),cDarkGreen,bf
line (0,281)-(639,440),cLightGray,bf
line (0,441)-(639,479),cDarkGreen,bf
for y as integer = 0 to 480 step 40
line (0,y)-(639,y+40),rgb(0,0,0),b
next y
bsave "fBackGround.bmp",0
print "DONE"
sleep
Code: Select all
#include "fbgfx.bi"
using fb
screenres 640,480,32 'before making any images
'images of pieces
dim shared as FB.Image ptr turtleR2
turtleR2 = imagecreate(59,37,0)
dim shared as FB.Image ptr turtleL2
turtleL2 = imagecreate(59,37,0)
dim as string char
for j as integer = 0 to 36
read char
for i as integer = 0 to 58
if mid(char,i+1,1) = "#" then 'black
pset turtleR2,(i,j),rgb(0,0,0)
'pset (i+100,j),rgb(0,0,0)
end if
if mid(char,i+1,1) = "." then 'brown
pset turtleR2,(i,j),rgb(185,122,87)
'pset (i+100,j),rgb(185,122,87)
end if
if mid(char,i+1,1) = "*" then 'yellow
pset turtleR2,(i,j),rgb(255,242,0)
'pset (i+100,j),rgb(255,242,0)
end if
if mid(char,i+1,1) = "'" then 'lime
pset turtleR2,(i,j),rgb(181,230,29)
'pset (i+100,j),rgb(181,230,29)
end if
if mid(char,i+1,1) = "+" then 'white
pset turtleR2,(i,j),rgb(255,255,255)
'pset (i+100,j),rgb(255,255,255)
end if
if mid(char,i+1,1) = " " then 'magenta
pset turtleR2,(i,j),rgb(255,0,255)
'pset (i+100,j),rgb(255,0,255)
end if
next i
next j
print "DONE"
put (100,100),turtleR2,pset
bsave "turtleR2.bmp",turtleR2
sleep
restore
'=========================================
for j as integer = 0 to 36
read char
for i as integer = 0 to 58
if mid(char,i+1,1) = "#" then 'black
pset turtleL2,(58-i,j),rgb(0,0,0)
'pset (i+100,j),rgb(0,0,0)
end if
if mid(char,i+1,1) = "." then 'brown
pset turtleL2,(58-i,j),rgb(185,122,87)
'pset (i+100,j),rgb(185,122,87)
end if
if mid(char,i+1,1) = "*" then 'yellow
pset turtleL2,(58-i,j),rgb(255,242,0)
'pset (i+100,j),rgb(255,242,0)
end if
if mid(char,i+1,1) = "'" then 'lime
pset turtleL2,(58-i,j),rgb(181,230,29)
'pset (i+100,j),rgb(181,230,29)
end if
if mid(char,i+1,1) = "+" then 'white
pset turtleL2,(58-i,j),rgb(255,255,255)
'pset (i+100,j),rgb(255,255,255)
end if
if mid(char,i+1,1) = " " then 'magenta
pset turtleL2,(58-i,j),rgb(255,0,255)
'pset (i+100,j),rgb(255,0,255)
end if
next i
next j
print "DONE"
put (100,100),turtleL2,pset
bsave "turtleL2.bmp",turtleL2
sleep
end
end
DATA " "
DATA " "
DATA " ### "
DATA " ### ##''# "
DATA " ###'### #'''''# "
DATA " #'''''## #'''''# "
DATA " #'''''''# ############# #'''''# "
DATA " ##''''''## ########....###### ##''''## "
DATA " ##''''''#####..###......##...####''''## "
DATA " ####'''##......#.......#.....##''''## "
DATA " ######.....##.......##......##'## "
DATA " #...##....##.......##.......### "
DATA " ##.....##..####.......#......##..# ##### "
DATA " ##......#####..##....#####...##....# #*****# "
DATA " #......####.....##.###...#####.....# ##**###*# "
DATA " ###....###..##.....###......###......# #'#***##*# "
DATA " ##''#..###.....##...####......####.....######'''#****#'#+"
DATA " #''''##########..#####..#....##...###..#''''''''''####'''#"
DATA "#'''''###..######.##.....######..###.####'''''''''''''''''#"
DATA " #''''##########..#####..#....##...###..#''''''''''####'''#"
DATA " ##''#..###.....##...####......####.....######'''#****#'# "
DATA " ###....###..##.....###......###......# #'#***##*# "
DATA " #......####.....##.###...#####.....# ##**###*# "
DATA " ##......#####..##....#####...##....# #*****# "
DATA " ##.....##..####.......#......##..# ##### "
DATA " #...##....##.......##.......### "
DATA " ######.....##.......##......##'## "
DATA " ####'''##......#.......#.....##''''## "
DATA " ##''''''#####..###......##...####''''## "
DATA " ##''''''## ########....###### ##''''# "
DATA " #'''''''# ############# #'''''# "
DATA " #'''''## #'''''# "
DATA " ###'### #'''''# "
DATA " ### ##''# "
DATA " ### "
DATA " "
DATA " "
Code: Select all
#include "fbgfx.bi"
using fb
screenres 640,480,32 'before making any images
'images of pieces
dim shared as FB.Image ptr turtleR1
turtleR1 = imagecreate(59,37,0)
dim shared as FB.Image ptr turtleL1
turtleL1 = imagecreate(59,37,0)
dim as string char
for j as integer = 0 to 36
read char
for i as integer = 0 to 58
if mid(char,i+1,1) = "#" then 'black
pset turtleR1,(i,j),rgb(0,0,0)
'pset (i+100,j),rgb(0,0,0)
end if
if mid(char,i+1,1) = "." then 'brown
pset turtleR1,(i,j),rgb(185,122,87)
'pset (i+100,j),rgb(185,122,87)
end if
if mid(char,i+1,1) = "*" then 'yellow
pset turtleR1,(i,j),rgb(255,242,0)
'pset (i+100,j),rgb(255,242,0)
end if
if mid(char,i+1,1) = "'" then 'lime
pset turtleR1,(i,j),rgb(181,230,29)
'pset (i+100,j),rgb(181,230,29)
end if
if mid(char,i+1,1) = "+" then 'white
pset turtleR1,(i,j),rgb(255,255,255)
'pset (i+100,j),rgb(255,255,255)
end if
if mid(char,i+1,1) = " " then 'magenta
pset turtleR1,(i,j),rgb(255,0,255)
'pset (i+100,j),rgb(255,0,255)
end if
next i
next j
print "DONE R1"
put (100,100),turtleR1,pset
bsave "turtleR1.bmp",turtleR1
sleep
restore
'=========================================
for j as integer = 0 to 36
read char
for i as integer = 0 to 58
if mid(char,i+1,1) = "#" then 'black
pset turtleL1,(58-i,j),rgb(0,0,0)
'pset (i+100,j),rgb(0,0,0)
end if
if mid(char,i+1,1) = "." then 'brown
pset turtleL1,(58-i,j),rgb(185,122,87)
'pset (i+100,j),rgb(185,122,87)
end if
if mid(char,i+1,1) = "*" then 'yellow
pset turtleL1,(58-i,j),rgb(255,242,0)
'pset (i+100,j),rgb(255,242,0)
end if
if mid(char,i+1,1) = "'" then 'lime
pset turtleL1,(58-i,j),rgb(181,230,29)
'pset (i+100,j),rgb(181,230,29)
end if
if mid(char,i+1,1) = "+" then 'white
pset turtleL1,(58-i,j),rgb(255,255,255)
'pset (i+100,j),rgb(255,255,255)
end if
if mid(char,i+1,1) = " " then 'magenta
pset turtleL1,(58-i,j),rgb(255,0,255)
'pset (i+100,j),rgb(255,0,255)
end if
next i
next j
print "DONE"
put (100,100),turtleL1,pset
bsave "turtleL1.bmp",turtleL1
sleep
end
DATA " ## "
DATA " ## #''# "
DATA " #''# #'''# "
DATA " #''''# #'''''# "
DATA " #'''''# #'''''# "
DATA " #''''''# #''''''# "
DATA " #''''''# ############# #'''''# "
DATA " ##'''''# ########....###### #''''# "
DATA " ##''''#####..###......##...##''''# "
DATA " ###''##......#.......#.....##'''# "
DATA " #####.....##.......##......##'# "
DATA " #...##....##.......##.......### "
DATA " ##.....##..####.......#......##..# ##### "
DATA " ##......#####..##....#####...##....# #*****# "
DATA " #......####.....##.###...#####.....# ##**###*# "
DATA " ###....###..##.....###......###......# #'#***##*# "
DATA " ##''#..###.....##...####......####.....######'''#****#'#+"
DATA " #''''##########..#####..#....##...###..#''''''''''####'''#"
DATA "#'''''###..######.##.....######..###.####'''''''''''''''''#"
DATA " #''''##########..#####..#....##...###..#''''''''''####'''#"
DATA " ##''#..###.....##...####......####.....######'''#****#'# "
DATA " ###....###..##.....###......###......# #'#***##*# "
DATA " #......####.....##.###...#####.....# ##**###*# "
DATA " ##......#####..##....#####...##....# #*****# "
DATA " ##.....##..####.......#......##..# ##### "
DATA " #...##....##.......##.......### "
DATA " #####.....##.......##......##'# "
DATA " ###''##......#.......#.....##'''# "
DATA " ##''''#####..###......##...##''''# "
DATA " ##'''''# ########....###### #''''# "
DATA " #''''''# ############# #'''''# "
DATA " #''''''# #''''''# "
DATA " #'''''# #'''''# "
DATA " #''''# #'''''# "
DATA " #''# #'''# "
DATA " ## #''# "
DATA " ## "
Code: Select all
#include "fbgfx.bi"
using fb
const SCRW = 640
const SCRH = 480
screenres SCRW,SCRH,32
color rgb(0,0,0),rgb(255,255,255)
cls
type aSPRITE4 'FOUR images
as integer x
as integer y
as integer w
as integer h
as integer dx
as integer dy
as integer f '# of current frame
as FB.Image ptr image(4) 'four images
end type
dim shared as aSPRITE4 turtle(8) 'four images
for i as integer = 0 to 7
read turtle(i).x
read turtle(i).y
turtle(i).w = 59
turtle(i).h = 37
if i > 3 then
turtle(i).dx = -1
else
turtle(i).dx = 1
end if
turtle(i).dy = 0
turtle(i).f = 0 'first image to display
turtle(i).image(0)= ImageCreate(turtle(i).w,turtle(i).h,0)
turtle(i).image(1)= ImageCreate(turtle(i).w,turtle(i).h,0)
turtle(i).image(2)= ImageCreate(turtle(i).w,turtle(i).h,0)
turtle(i).image(3)= ImageCreate(turtle(i).w,turtle(i).h,0)
bload "turtleR1.bmp",turtle(i).image(0) 'turtle going right
bload "turtleR2.bmp",turtle(i).image(1)
bload "turtleL1.bmp",turtle(i).image(2) 'turtle going left
bload "turtleL2.bmp",turtle(i).image(3) '
next i
dim shared as FB.Image ptr backGround
backGround = ImageCreate(640,480,0)
'bload "C:/FreeBasic/GAMES/BITMAPS/Background.bmp",backGround
bload "fBackGround.bmp",backGround
dim shared as double displayCounter,frameCounter
displayCounter = timer
frameCounter = timer
sub display()
screenlock()
put (0,0),backGround,pset
for i as integer = 0 to 7
if turtle(i).dx = 1 then
put (turtle(i).x,turtle(i).y),turtle(i).image(turtle(i).f),trans
else
put (turtle(i).x,turtle(i).y),turtle(i).image(turtle(i).f+2),trans
end if
next i
displayCounter = timer 'reset display counter
locate 3,30
print "HIT ESC KEY TO EXIT"
screenunlock()
end sub
sub upDate()
'move sprite
for i as integer = 0 to 7
turtle(i).x = turtle(i).x + turtle(i).dx
'check range
if turtle(i).x > SCRW + turtle(i).w or turtle(i).x < - turtle(i).w then
turtle(i).dx = -turtle(i).dx 'reverse
end if
next i
if timer - frameCounter > .5 then
for i as integer = 0 to 7
if turtle(i).f = 0 then turtle(i).f = 1 else turtle(i).f = 0 'toggle images
next i
frameCounter = timer
end if
end sub
' ********** MAIN LOOP **********
do
if timer - displayCounter > 0.05 then
upDate()
display()
end if
loop until multikey(&H01)
' ************************************
sleep
for i as integer = 0 to 7
imageDestroy turtle(i).image(0)
imageDestroy turtle(i).image(1)
next i
data -60,82,130,82,320,82,510,82
data 160,162,360,162,520,162,660,162
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
Thank you for the idea and for the demo. Nice swimming turtles.BasicCoder2 wrote:One fix is that the sprites should exit and enter the screen not just turn around. I discovered that FreeBasic's graphics can handle images with coordinates outside the screen coordinates. Below is a demo but apart from the turtle I haven't had time to convert all the graphics to data statements so all you see are turtles.
Code: Select all
sCar(1).dx = -1'1
sCar(2).dx = -1'1
Code: Select all
for i as integer = 1 to 4
'if sCar(i).x < 1 or sCar(i).x > 330 then sCar(i).dx = - sCar(i).dx
'if sCar(i).x < 0 - sCar(i).w then sCar(i).x = 371
'if sCar(i).x > 371 then sCar(i).x = 0 - sCar(i).w
if sCar(i).x < 0 - sCar(i).w - int(50 * rnd) then sCar(i).x = 371
if sCar(i).x > 371 + int(50 * rnd) then sCar(i).x = 0 - sCar(i).w
next i
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Frogger revisited
Good job, reminds me on m'y old Commodore C64.
Joshy
Joshy
-
- Posts: 993
- Joined: Nov 24, 2011 19:49
- Location: France
- Contact:
Re: Frogger revisited
Hello!
I have updated the file, for compilation with FBC 1.05.0 and fbsound 1.0.
Download Frogger (ZIP file including source code and Win32 binary)
FreeBASIC Portal
I have updated the file, for compilation with FBC 1.05.0 and fbsound 1.0.
Download Frogger (ZIP file including source code and Win32 binary)
FreeBASIC Portal