RayFaster 2



Click to activate. Use arrow keys to move around and SPACE to jump.
Important: added a simple scripting system. The editor has a compiler for a simple language and the SWF has the VM for executing the scripts. To see it, try to move forward. Here is the script that does what you see:


var jumped;

# script 1 is executed when the world is loaded
script 1
{
	setSectorEffect(40, 0); # stop fan from rotating
	createEntityPhysicsObject(10); # add a physics object for the gargoyle
	jumped = 0;
}

# script 2 is triggered from the sector 35
script 2
{
	setSectorEffect(40, 5); # start the fan
	setSectorShade(39, 0); # make the fan's exterior bright

	# the gargoyle will jump only once
	if (jumped == 0) {
		applyEntityForce(10, fixed(1), fixed(-10), fixed(20));
		jumped = 1;
	}
}


The available functions for scripts are:

Core: stop, concat, print, time, run, say, set, get, str and int

Math: angle, distance, max, min, abs, sin, asin, cos, acos, tan, atan, sqr, sqrt, floor, pow, random, fixed, defix

World: nextWorld, loadWorld, setLightPattern

Sectors: setFloorZ, getFloorZ, setCeilingZ, getCeilingZ, setFloorTexture, getFloorTexture, setCeilingTexture, getCeilingTexture, setSectorShade, getSectorShade, setSectorEffect, getSectorEffect, setSectorLighting, getSectorLighting, triggerSector, slideSectorTo, rotateSectorTo, slideFloorTo, slideCeilingTo, getSectorEntityCount, getSectorEntity, getSectorWallCount, getSectorWall

Walls: setWallTexture, getWallTexture, setWallTextureShift, getWallTextureShift, getWallLength, getFrontSector, getBackSector, triggerWall, getWallVertexX, getWallVertexY, setWallVertexX, setWallVertexY

Entities: spawn, setEntityPos, getEntityX, getEntityY, getEntityZ, setEntityAngle, getEntityAngle, setEntityAlign, getEntityAlign, setEntityTexture, getEntityTexture, setEntityScale, getEntityScaleX, getEntityScaleY, createEntityPhysicsObject, slideEntityTo, applyEntityForce, setEntityGravity

Rendering: setCameraPos, setCameraAngle, getCameraX, getCameraY, getCameraZ, getCameraAngle, applyCameraForce



r>Editor screenshot