Skip to content

Instantly share code, notes, and snippets.

View mudhairless's full-sized avatar

Ebben Feagan mudhairless

View GitHub Profile
@mudhairless
mudhairless / logging.bas
Created February 2, 2014 22:43
Example for the logging module of the Extended Library
#include once "ext/log.bi"
using ext
sub my_custom_log( byval l as loglevel, byref m as const string, byref f as const string, byval l_ as integer, byval fd as any ptr )
print m
end sub
enum MyChannels
MAIN_C = 0
FILE_C
@mudhairless
mudhairless / decodehtml.bas
Created February 8, 2014 17:24
Decode HTML entities in a file.
''Copyright (c) 2007-2014, FreeBASIC Extended Library Development Group
''
''All rights reserved.
''
''Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
''
'' * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
'' * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
'' * Neither the name of the FreeBASIC Extended Library Development Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
''
@mudhairless
mudhairless / Lightbox.js
Created January 30, 2015 15:33
My fix for xtLightbox not centering in IE11
/*
---
name: XtLightbox.Renderer.Lightbox
description: extendable lightbox default Lightbox Renderer
license: MIT-style
authors:
- Anton Suprun <kpobococ@gmail.com>
/*
---
name: XtLightbox.Renderer
description: extendable lightbox Renderer base
license: MIT-style
authors:
- Anton Suprun <kpobococ@gmail.com>
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
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
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
'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
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
for i as integer = 1 to 4
delete car(i)
delete logs(i)
delete pads(i)
next
delete pads(5)
imagedestroy background