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
'Flying Toasters with Toast | |
'Inspired by the classic After Dark screensaver. | |
'Consider this code under the terms of the STFUOIWCU license <http://mud.owlbox.net/license/STFUOIWCU> | |
' | |
'Compile with: | |
'fbc -s gui -w all -x flyer.scr flyer.bas flyer.rc | |
#include "ssk.bas" | |
#include once "fbgfx.bi" | |
function RndRange (byval min_ as integer, byval max_ as integer, byval getnew as integer = 1) as integer |
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
'modded by sir_mud 11/2013 to run with FB 0.90.1 (differences in ThreadCreate and added extremely minimal ini config) | |
' tweaked by tinram 6/6/07 to run with FB 0.17b (RETURNs in CASE statements were killing it) | |
' 0.16 original by jofers | |
'Option Explicit | |
#include "windows.bi" | |
type configuration |
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
function average ( arr() as integer ) as integer | |
var ret = 0 | |
for n as integer = 0 to ubound(arr) | |
ret += arr(n) | |
ret /= 2 | |
next | |
return ret | |
end function |
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
<document lang="en_US"> | |
<title>Document title</title> | |
<author bio="http://site.com/author" email="author@site.com">Joe Author</author> | |
<summary>This is a sample document.</summary> | |
</document> |
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 "ext/xml/dom.bi" | |
var xmldoc = new ext.xml.tree | |
xmldoc->load("mydocument.xml") | |
var xmlroot = xmldoc->root | |
print "Children of document: " & xmlroot->child("document")->children | |
print "Author: " & xmlroot->child("document")->child("author")->getText | |
var doc = xmlroot->child("document") | |
print "Author Bio: " & doc->child("author")->attribute("bio") |
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 "ext/xml/dom.bi" | |
var xmldoc = new ext.xml.tree | |
xmldoc->load("mydocument.xml") | |
var xmlroot = xmldoc->root | |
'do stuff | |
xmldoc->unload("mydocument.xml") | |
delete xmldoc |
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
sub hello_world() | |
print "Hello, World" | |
end sub | |
hello_world() |
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
for i as integer = 1 to 4 | |
delete car(i) | |
delete logs(i) | |
delete pads(i) | |
next | |
delete pads(5) | |
imagedestroy background |
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 temp_cy < 352 and temp_cy > 224 then | |
'test for collision with car | |
for i as integer = 1 to 4 | |
if frog.isCollided( *(car(i)) ) then frog_dir = FROG_DEAD | |
next i | |
end if | |
if temp_cy < 192 and temp_cy > 64 then | |
'test collision with a log | |
for i as integer = 1 to 4 | |
if frog.isCollided( *(logs(i)) ) then chosenLog = 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
if timer > (now + 0.25) then | |
if multikey(SC_SPACE) then reply = "y" | |
if multikey(SC_ESCAPE) then reply = "x" | |
if temp_cy > 63 and frog_dir < FROG_DEAD then'test frog hasn't reached home | |
if multikey(SC_DOWN) and temp_cy <352 then | |
frog.update(0, frog_speed) | |
now = timer | |
chosenLog=0 | |
frog_dir = direction.south | |
end if |