The OOP can now reference any CSS color like so:
#change #ffffff gem "rgba(255, 0, 0, 0.5)" gem
#bgcolor #ff0000
#fgcolor #000000
Actions, Status Menu items and types are now programmable, here is an example:
The following registers a new type called "shell"
Code: Select all
#register shell "gravity=true|movex=true|movey=true|cpumove=true"
#char 31
#walk flow
#cycle 0
#set this.cntr 0
:loop
#set this.cntr `${this.cntr}+1`
#if `${this.cntr} <= 10` then #char 31
#if `${this.cntr} > 10` then #char 118
#if `${this.cntr} > 20` then #set this.cntr 0
#loop
:hurtplayer
Ouch!
#take health 10
#sound effect play hurt
#die
:reverse
#walk opp flow
#sound effect play bump
#end
:thud(dir, x, y)
#zap thud
#if `${this.x} <= 0 OR ${this.x} >= ${board_width}-1` then #die
#query pos `${label.x}` `${label.y}` ".enemy=shot|breakable=destroy|@prizebox=touch(`SOUTH`)|SHELL=#die|player=shot" return label.idx
#if `${label.idx} == 4` then #call hurtplayer
#if `${label.idx} == 3` then #die
#if `${label.idx} != 0` then #call reverse
#restore thud
#loop
#end
The following removes the action "SHOOT" and adds a new action called "Shell". It also creates a variable called "shells" set to 15 and adds it to the Status Menu.
Code: Select all
#action remove shoot ' remove shoot action
#stats remove ammo ' remove ammo from status menu
#action add Shell onactionkick ' add new action called shell
#set shells 15 ' create a counter for new item
#stats add Shells shells ' add it to status menu
The following is added to the global "SYSTEM" object and processes the new action
Code: Select all
:onactionkick(dir)
#if `${shells} <= 0` then #end
#set shells `${shells}-1}`
#if `${label.dir} == NORTH OR ${label.dir} == SOUTH` then #end
#tryput `${label.dir}` #ffffff shell
#sound effect play kick
#end
That's a complete example of a new type, status menu item, and action.
Sound effects have been changed to mp3's.
Some new commands:
#query - Allows you to query a position or direction and send messages to the object it finds
#bgcolor <CSS color> - change background color
#fgcolor <CSS color> - change foreground color
#mirror <obj name> - Mirrors movement of an object and is atomic meaning all mirror objects either suceed or fail in movement
#tryput - same as #put but will send a msg if cannot put object in direction
#create - Create an object of a type or send a message if position is occupied
#moveto - Move an object to a position or send a message if position is occupied
#draw - Draws to active object layer for animations or overlay layer
http://webchars.com