Quantcast
Channel: Code snippets | Web and game development | Generative art
Browsing latest articles
Browse All 10 View Live

Image may be NSFW.
Clik here to view.

Lights and shadows experiment

Recently I found an interesting question on FlashFocus.nl, about creating light and shadows in a 2D environment. I started experimenting with this to see how far I could take it. I love to share the...

View Article


Image may be NSFW.
Clik here to view.

JSFL dialog

While playing with JSFL and trying to create a faster interface for my name it right.jsfl I stumbled across a very interesting function inside JSFL. There is a powerful function called...

View Article


Image may be NSFW.
Clik here to view.

Simple javascript template system

If you want to use strings as simple templates in javascript, you might want to use my template script. You can do stuff like this: var template = "Hello my name is {person.name}, I’m {person.age}...

View Article

Image may be NSFW.
Clik here to view.

Random seed – actionscript

If you want a fast random seed, you could use this very simple class. This blogpost is mostly a useful copy-paste location for myself. I got this solution from http://www.calypso88.com, but the blog...

View Article

Image may be NSFW.
Clik here to view.

Flambe code snippet: Control overall speed

Flambe has a nice specialized component called SpeedAdjuster. It adjusts the update speed of an entity (and its components and children), and can be used for slow – motion and fast forward effects....

View Article


Image may be NSFW.
Clik here to view.

Flambe snippet: game heartbeat

This is a post about a gameplay-element that affects how game objects can be triggered on a certain “heartbeat”. This relative simple component brings some interesting features. I created a code...

View Article

Image may be NSFW.
Clik here to view.

Grabbing conditional compilation values using macro functions

This post is about grabbing conditional compilation values and print them in the output context using a macro function. Then we can use it at runtime. Let’s say you want to display in runtime if your...

View Article

Image may be NSFW.
Clik here to view.

Wait a minute with setTimeout

While working on a game, I created a function spawner. The idea was to make a function which would call a function like createEnemy() a hundred times with an interval. So I quickly created a static...

View Article

Browsing latest articles
Browse All 10 View Live