0 Members and 1 Guest are viewing this topic.
Lbl OClrDrawLine(19,1,19,57)Line(26,1,26,57)Line(33,1,33,57)Line(40,1,40,57)Line(47,1,47,57)Line(54,1,54,57)Line(61,1,61,57)Line(68,1,68,57)Line(75,1,75,57)Line(19,1,75,1)Line(19,8,75,8)Line(19,15,75,15)Line(19,22,75,22)Line(19,29,75,29)Line(19,36,75,36)Line(19,43,75,43)Line(19,50,75,50)Line(19,57,75,57)Pt-On({L+1},{L‚+1},Pic2R)Pt-On({L+2},{L‚+2},Pic2NPt-On({L+3},{L‚+3},Pic2B)Pt-On({L+4},{L‚+4},Pic2Q)Pt-On({L+5},{L‚+5},Pic2K)Pt-On({L+6},{L‚+6},Pic2B)Pt-On({L+7},{L‚+7},Pic2N)Pt-On({L+8},{L‚+8},Pic2R)Pt-On({L+9},{L‚+9},Pic2P9)Pt-On({L+10},{L‚+10},Pic2P10)Pt-On({L+11},{L‚+11},Pic2P11)Pt-On({L+12},{L‚+12},Pic2P12)Pt-On({L+13},{L‚+13},Pic2P13)Pt-On({L+14},{L‚+14},Pic2P14)Pt-On({L+15},{L‚+15},Pic2P15)Pt-On({L+16},{L‚+16},Pic2P16)Pt-On({L„+1},{L…+1},Pic1R)Pt-On({L„+2},{L…+2},Pic1N)Pt-On({L„+3},{L…+3},Pic1B)Pt-On({L„+4},{L…+4},Pic1Q)Pt-On({L„+5},{L…+5},Pic1K)Pt-On({L„+6},{L…+6},Pic1B)Pt-On({L„+7},{L…+7},Pic1N)Pt-On({L„+8},{L…+8},Pic1R)Pt-On({L„+9},{L…+9},Pic1P9)Pt-On({L„+10},{L…+10},Pic1P10)Pt-On({L„+11},{L…+11},Pic1P11)Pt-On({L„+12},{L…+12},Pic1P12)Pt-On({L„+13},{L…+13},Pic1P13)Pt-On({L„+14},{L…+14},Pic1P14)Pt-On({L„+15},{L…+15},Pic1P15)Pt-On({L„+16},{L…+16},Pic1P16)Pt-On({Lƒ+17},{Lƒ+18},Pic3)DispGraphReturn
Lbl P1ü{Lƒ+18}19ü{Lƒ+17}Repeat (getKey(56))sub(M)If (getKey(54))If (({Lƒ+17}=19) and ({Lƒ+18}=1))DelVar Pic1P1Pic1NüPic1P12üYEndEndClrDrawPt-On(19,1,Pic1N)Pt-On(26,1,Pic1B)Pt-On(33,1,Pic1R)Pt-On(40,1,Pic1Q)EndReturn
data structure:-sprites:[hexWPAWN]->Pic1PCS[hexWBISHOP][hexWKNIGHT][hexWROOK][hexWQUEEN][hexWKING][continue here for the 6 black pieces]-------how the pieces are stored in L1:{taken?(0 if still on the board),xpos,ypos,pieceno(0=pawn,1=bishop, just like the sprite arrangement, and no need for B/W pieces)}-----Now the big thing: drawing the stuff.For(A,0,31) if {A*4+L1}=!0 A>15->B pt-on(A*4+L1+1,A*4+L1+2,8*{A*4+L1+3}+Pic1PCS+48*B) ;; the x and y positions might be a bit off. you should change this later on. endend
Hey, I need to change a sprite from one hex to another during promotion. I DelVar the sprite, then create a new one with the same name, and assign a new hex to said sprite... but when compiling, I get an invalid token error... any ideas?
the difference here is that, in basic, STR1 is the name of an external object that is created in ram when the program is running, and can be modified however you choose. in axe, however, STR1 is a pre-processor directive. there is no actual object named STR1 that is created, and it is not used at all by your running program. STR1 is a label used by the compiler to point to a specific spot in your compiled program itself, so you can't tell it to point to two different places at once, which is what saying "store X" -> STR1 and then "store Y" -> STR1 is doing. the first time the compiler sees that, it appends the data "store X" to your program and then labels that point as STR1 for everything else to use. the second line would, then, be trying to append data at a different spot in the program and tell the compiler that that place is also called "STR1", which is causing an issue.now, all that being said, it's easy enough to modify data stored at an STR#, GDB#, or PIC# label later on, provided that you are compiling a program, that will run in standard RAM space, rather than an application. you have to use the label as a part of a pointer, though, and store all the number values manually. it's much easier to work with free ram areas outside of your own program, like hayleia showed above.
It says Duplicate Symbol because you are using twice the pointer Str1.Note that Str1 is a pointer, not a string, and Axe is not Basic What you can do is that: "STRING1"→GDB1 "1GNIRTS"→GDB2Then, when you need the first string, do that: Fill(L1,8,0) Copy(GDB1,L1,7)Now, at the pointer L1, you have a null-terminated string with "STRING1"[00] in it And to get the second string in L1, do that: Fill(L1,8,0) Copy(GDB2,L1,7)