Skip to content

Instantly share code, notes, and snippets.

Import diddy
Import mojo
Class TestScreen Extends Screen
Method Start:Void()
End
{TRON-LASERBIKES by (c) T.Luyben && J.Straaten 1988, revised for TP7.0 VGA,
THIS GAME IS FREEWARE AND MAY BE COPIED... DO NOT ALTER THIS FILE OR THE
ZIP FILE YOU COPY...
IF YOU CHANGE ANYTHING THEN PLEASE LET ME KNOW! NO PROFIT SHALL BE MADE FROM
THIS LITTLE PROJECT
}
uses crt,dos;
const cdlevel=3; {here you can change the difficulty level; there is a}
Field parentCache:GuiVector2D
'summary: This returns the rendering position of this control. The result is presented on Device coordinates. (screen pixels)
Method CalculateRenderPosition:GuiVector2D()
If _cacheRenderPosCalcuation = Null Then _cacheRenderPosCalcuation = New GuiVector2D
_cacheRenderPosCalcuation.SetValues (Position.X, Position.Y)
If parentCache = Null
parentCache = New GuiVector2D()
@tluyben
tluyben / gist:5472601
Last active December 16, 2015 17:48
Monkey SoundPool repeat trying in a Thread.
// add on top of gxtkAudio
class PlaySampleThread extends Thread {
SoundPool pool;
gxtkSample sample;
gxtkAudio.gxtkChannel chan;
float lv, rv;
int loops;
public PlaySampleThread(SoundPool pool, gxtkSample sample, gxtkAudio.gxtkChannel chan, float lv, float rv, int loops) {
@tluyben
tluyben / unpack ipk
Created May 10, 2013 10:30
Unpacking all ipkgs in some root directory
#!/usr/bin/perl
$d = $ARGV[0];
while(glob("$d/*.ipk")) {
chomp;
`tar xf $_`;
`tar pxzf data.tar.gz`;
}
@tluyben
tluyben / gist:5553679
Created May 10, 2013 10:46
/etc/config/fstab
config 'mount'
option 'target' '/mnt/mmcblk0p1'
option 'device' '/dev/mmcblk0p1'
option 'fstype' 'ext2'
option 'options' 'ro'
option 'enabled' '1'
option 'enabled_fsck' '0'
@tluyben
tluyben / gist:5553685
Created May 10, 2013 10:48
/etc/profile.d/zipit-mmc.sh
export PATH=/mnt/mmcblk0p1/usr/bin:/mnt/mmcblk0p1/bin:$PATH
export LD_LIBRARY_PATH=/mnt/mmcblk0p1/usr/lib
@tluyben
tluyben / gist:5563410
Created May 12, 2013 12:33
open msx compile zipit
#!/bin/sh
cd /home/openwrt/openmsx-openmsx
export STAGING_DIR=/home/openwrt/src/zipit/openwrt-zipit/staging_dir
export CXX=/home/openwrt/src/zipit/openwrt-zipit/staging_dir/toolchain-arm_v5te_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-uclibcgnueabi-g++
make clean
rm -fR derived/*
make staticbindist OPENMSX_TARGET_CPU=arm CXX=$CXX OPENMSX_FLAVOUR=zipit LINK_MODE=3RD_STA_MIN
@tluyben
tluyben / gist:5604660
Last active December 17, 2015 11:49
Sinusscroller in Monkey
Function UpdateAd()
If Not gameScreen.adsOn Return
If _MouseClick() And _MouseIn(New Vector2D(0, SCREEN_HEIGHT-80), New Vector2D(SCREEN_WIDTH, 80))
LaunchNativeBrowser(ADLINK, ADLINK)
End
End
Function RenderAd()
If Not gameScreen.adsOn Return
SetColor 0,0,0
Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.
Act I: Hamlet's insults and flattery.
Scene I: The insulting of Romeo.
[Enter Hamlet and Romeo]
Hamlet:
You lying stupid fatherless big smelly half-witted coward! You are as