#include "globals.prg"
cnv!=createcanvas(800,600)
ct!=createcanvas(800,600)
bitmap(menbkg$="clockwerk.png",cnv!)
pcursor()
setpos(0, 120,60, 2,1,0,0)
setpos(1, 120,100, 0,2,1,1)
setpos(2, 120,140, 1,0,2,2)
cursormove(0)
finish!=0
while(!finish!)
{
direct$=wait()
switch(direct$)
{
case ("UP") {cursormove(move["UP"]!)}
case ("DOWN") {cursormove(move["DOWN"]!)}
case ("LEFT") {cursormove(move["LEFT"]!)}
case ("RIGHT") {cursormove(move["RIGHT"]!)}
case ("D") {rpgcode(action$)}
}
}
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//constructor-type dealie, slightly overloaded
method pcursor() //sets up the array index
{
cvindex!=-1 //eventually used for debugging and such
curs$=cfile$ //crystally cursor that is in all the old screenies!
cx!=32
cy!=32
cur!=createcanvas(cx!,cy!)
setimagetransparent(curs$, 0, 0, cx!, cy!, 0, 0, 0, cur!)
}
method pcursor(file$, x!, y!) //ovrloaded form used for possible mutiple skins,
{ //also other cursors of different sizes
cvindex!=-1
curs$=file$
cx!=x!
cy!=y!
cur!=createcanvas(cx!,cy!)
setimagetransparent(curs$, 0, 0, cx!, cy!, 0, 0, 0, cur!)
}
//stores all the positions into two arrays to be accessed later
method setpos(x!, y!) //this form sets up the index the order it is instanced
{
cvindex!++
px[cvindex!]!=x!
py[cvindex!]!=y!
}
method setpos(x!, y!, cnvindex!) //this form allows custom indexing
{
px[cvindex!]!=x!
py[cvindex!]!=y!
}
method cursormove(posindex!)
{
move[key00$]!=dir[posindex!][key00$]!
move[key01$]!=dir[posindex!][key01$]!
move[key02$]!=dir[posindex!][key02$]!
move[key03$]!=dir[posindex!][key03$]!
clear(ct!)
drawcanvas(cnv!,0,0)
drawcanvastransparent(cur!,px[posindex!]!,py[posindex!]!,0,0,0)
pixeltext(200,400,"<move[key02$]!>")
}
Look at putdir(): can i have it so that if i put in smth like (-1) and teh move will be false, ie not happen? the way i have it now, if i put in a (-1) for a field, it just goes to defaults (ie canvas drawn to (0,0) and all move options set to 0). even better if i can put some character to perform that instead of (-1).