Random posts

qrleon's picture


Game File: 


Made For: 
Pirate Kart 2
ghettoshamrock's picture

Broken link the game

i'm a broken link... one day i'll exist and be renamed into something great... until then enjoy this adventure in its full linkbrokennessness. enjoy.

Made For: 
An event
eruiz00's picture

Algebraic Tiles

Game File: 

Simple game teaching how to solve quadratic equations...

Used in real schools in Spain!

Made For: 
An event
Radix's picture





Made For: 
Pirate Kart 2
Redbone's picture

Super Radical Space Asteroids 8000

Game File: 

A completely original game. It isn't a clone of an old arcade game. Nope, not at all.

Made For: 
An event
Dattorz's picture

Disco Headache


Wanted to see if I could make a game in two hours using Klua.

This is a remake of the TI-83 calculator game "Aspirin" except with a flashing color background, a widescreen aspect ratio and more fairness (you'll never witness a laser spawning inside you).

Press F to enter/exit Fullscreen Mode so you can see just how awful your graphics drivers are at not creating a tear at the top of the screen when doing V-Sync. Or is it a LOVE/Klua issue? I don't know...

Music by Torley.

For Windows and Linux.

Event Created For: 
Made For: 
An event

Twine macro: <<timedgoto>>, a simple timer

This is inspired by the Timer script used in Panic! by Astrid Bin and Stefano Russo. That script implements a sophisticated timer entity which can count down throughout the entire game, can draw itself in graph form in a canvas element, and can be paused and resumed. However, it requires multiple macros to set it up for each use, and it can be a bit cumbersome if you simply want the game to advance to a new passage after a delay.

I felt like writing a similar macro that would be shorter and more specific. This one, <<timedgoto>>, just automatically (and invisibly) goes to the given passage after the given amount of time has passed. Each use of the macro only functions within the passage that uses it - if you're using Sugarcane or single-passage Jonah and leave the passage by a normal link, it will be disengaged. Feel free to consider this a counterpart to <<timedreplace>>.

macros["goto"]=macros.timedgoto={timer:null,handler:function(a,b,c,d){function cssTimeUnit(s){if(typeof s=="string"){if(s.slice(-2).toLowerCase()=="ms"){return +(s.slice(0,-2))||0
}else{if(s.slice(-1).toLowerCase()=="s"){return +(s.slice(0,-1))*1000||0
}}}throwError(a,s+" isn't a CSS time unit");return 0}var t,d,m,s;

New: This now takes CSS time values, which are decimal numbers ending in "s" (for seconds) or "ms" (for milliseconds). You can use fractions of seconds as well as whole seconds.

Usage examples:
* <<timedgoto "underwater" 2.5s >> goes to the "underwater" passage if you stay at the current passage for 2 and 1/2 seconds.
* <<timedgoto $deathpassage 5s >> goes to the passage whose name is in the $deathpassage variable if you stay at the current passage for 5 seconds.
* <<timedgoto $playerType + "pit" 1s >> goes to the $playerType + "pit" passage if you stay at the current passage for 1 second.
* <<goto "Throne">> - This shorter version functions the same as <<timedgoto "Throne" 0s>>.
* This uses code parameters (that is, it accepts "strings", $variables, and "various"+$combinations of both, and its parameters are interpreted as Javascript), except that the final parameter (the time value) is separated from the rest and interpreted as a literal parameter.

Version history:

  1. 1-9-2013 - Fixed a bug where it caused problems with the (un-patched) browser Back button code.
  2. 18-4-2013 - Changed time units to CSS units, added "goto" variation.
  3. 5-3-2013 - Initial.

Feel free to report any bugs to @webbedspace.

Timer Test.tws9.42 KB
Spygalla's picture




Event Created For: 
Made For: 
Pirate Kart 2
.KKliker's picture

We have got to stop forgetting to update the Kontest page lists...

I always keep seeing recent Klik of the Month contests forget to be included in the Klik of the Month list for up to several months on end. For example, I just checked over there and it's missing contest #30 and 31. It's also technically missing #32, since that one just ended. Come on, people! You really need to keep this page in better sync with the contests.

Twine: either(), a random picker function

Update: This script is now built into Twine 1.4! It is no longer necessary to install it.

This is a very short script that allows you to use a function called "either" in Twine's <<set>>, <<print>> and <<if>> macros. Give it several string or number values, separated by commas, and it will pick one of them randomly to use in the macro.

Obsolete script removed: use Twine 1.4

This functions largely identically to the Game Maker choose() function. You can use it like this:

<<print either("a dusty glade", "a sinister vale", "a murky gully", "a desolate gulch") >> - Prints one of the strings, chosen randomly.

<<set $value = either(0,1,2,3,4)>> - Sets $value to one of the numbers.

<<if either(true, false)>> - This is true 50% of the time. Equivalent to <<if Math.random() lt 0.5>>

In the first case, you can see it's functionally similar to the <<rnd>> macro - but, as demonstrated, it can also be used inside <<set>> as well as <<print>>.

If you patch the <<display>> macro, you can also use it to display a random passage, serving as a more primitive kind of <<randomp>>:

<<display either("Cellar", "Garden", "Observatory")>>

Feel free to report any bugs to @webbedspace.

Syndicate content