Author Topic: AXECHESS - The First Chess made in Axe  (Read 23931 times)

0 Members and 2 Guests are viewing this topic.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #15 on: November 08, 2012, 08:45:56 am »
no, you can make illegal moves though... HOW they move is what is in the code... WHERE they CAN is not in yet...
I am Bach.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: AXECHESS - The First Chess made in Axe
« Reply #16 on: November 08, 2012, 09:14:43 am »
*puzzles*
So if I get it right, you can have 2 pieces on one square or so?
I'm not a nerd but I pretend:

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #17 on: November 08, 2012, 09:19:40 am »
kinda... only pawns when not using a capturing move.
« Last Edit: November 08, 2012, 09:54:06 am by pimathbrainiac »
I am Bach.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #18 on: November 09, 2012, 09:50:22 am »
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?
I am Bach.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: AXECHESS - The First Chess made in Axe
« Reply #19 on: November 09, 2012, 09:58:34 am »
Can't you just not display the pawn and draw a queen (or something else) instead?
I'm not a nerd but I pretend:

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #20 on: November 09, 2012, 10:03:02 am »
if you look at the graphics routine, no...

Code: [Select]
Lbl O
ClrDraw
Line(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},Pic2N
Pt-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)
DispGraph
Return

I need to physically change the sprite assignment

this is where I get the error:

Code: [Select]
Lbl P
1ü{Lƒ+18}
19ü{Lƒ+17}
Repeat (getKey(56))
sub(M)
If (getKey(54))
If (({Lƒ+17}=19) and ({Lƒ+18}=1))
DelVar Pic1P1
Pic1NüPic1P1
2üY
End
End
ClrDraw
Pt-On(19,1,Pic1N)
Pt-On(26,1,Pic1B)
Pt-On(33,1,Pic1R)
Pt-On(40,1,Pic1Q)
End
Return
I am Bach.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: AXECHESS - The First Chess made in Axe
« Reply #21 on: November 09, 2012, 10:26:23 am »
Ok I made your graphics routine slightly shorter, but your data needs to be restructured.
Code: [Select]
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.
  end
end
I think that will do it :D
« Last Edit: November 09, 2012, 10:49:40 am by aeTIos »
I'm not a nerd but I pretend:

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #22 on: November 09, 2012, 11:47:43 am »
I'm going to try the graphics addition now...
I am Bach.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: AXECHESS - The First Chess made in Axe
« Reply #23 on: November 09, 2012, 11:48:12 am »
Ok. I gotta eat now, post any questions you got :)
I'm not a nerd but I pretend:

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #24 on: November 09, 2012, 12:21:06 pm »
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?
Wait, did you try to do for example this ?
   [<Hex>]→Str1
   .code
   Delvar Str1
   .code
   [<Hex>]→Str1

O.O
That is not possible in Axe. I quote shmibs here because he explains very well:
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.
And since shmibs' post tells about one of my post, I quote it too:
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"→GDB2

Then, 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)

« Last Edit: November 09, 2012, 12:21:33 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #25 on: November 09, 2012, 12:23:42 pm »
Hmm...Might I recommend a 3-level gray, where the tiles are grey and white? That way you can use more of the tile (no outlines) leading to larger, better looking pieces.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #26 on: November 09, 2012, 01:30:59 pm »
I want to get the basic mechanics down first

Edit: Hayleia, I have no idea what you mean
« Last Edit: November 09, 2012, 03:06:03 pm by pimathbrainiac »
I am Bach.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: AXECHESS - The First Chess made in Axe
« Reply #27 on: November 09, 2012, 03:13:24 pm »
To summarize hayleia's point: str, gdb, pic are not the same as the Basic str, pic, gdb.
I'm not a nerd but I pretend:

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: AXECHESS - The First Chess made in Axe
« Reply #28 on: November 09, 2012, 06:14:36 pm »
I'd recommend having an array filled with each piece. Each piece would then have the following attributes: position and type (from which the sprite and moves could be derived). It'd be a lot simpler than what you're doing right now - that way, you can just swap out the type, subsequently changing the sprite pointers and movement rules.
In-progress: Graviter (...)

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: AXECHESS - The First Chess made in Axe
« Reply #29 on: November 09, 2012, 07:08:26 pm »
it needs one more attribute: Alive or dead. Way easier than having a dynamically resizing list, and you just check that first before moving.