• Axe Q&A 5 5
Currently:  

Author Topic: Axe Q&A  (Read 536088 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #870 on: October 29, 2011, 04:54:09 pm »
You mean a 12x8 grid right?  The answer is X=N^12  Y=N/12  where N is your number in the list.  Also for future reference, what you are describing is a simple tilemap :)

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #871 on: October 29, 2011, 05:19:09 pm »
That doesn't quite work, as that is storing the pointer into Pic1, not storing the pointer as Pic1.  This will also modify your program if you use a shell like MirageOS.  Probably the best design would be something like this:

Code: [Select]
[SPRITE DATA 1]->Pic1
[SPRITE DATA 2]
[SPRITE DATA 3]
...

Pt-On(X,Y,G*8+Pic1

Where G=0 is the first sprite, G=1 is the second sprite, and so on

It doesn't work. It just screws up the sprites.

Edit: Wait... What the heck, it works now.
« Last Edit: October 29, 2011, 05:26:00 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #872 on: October 29, 2011, 05:26:16 pm »
Could you post how you implemented it?  

EDIT: Yay :) There might be some other part of your code that is intermittently messing with your graphics it would seem o.O
« Last Edit: October 29, 2011, 05:27:09 pm by Builderboy »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #873 on: October 29, 2011, 05:49:24 pm »
When it screwed up my sprite the first time, it made it look kinda like a horse :P

I tried it and it failed, that was this morning. Then, I changed the code and fixed some unrelated errors. After I posted I  tried to get it to work again... and it worked.


The only thing I think I did differently was instead of
Pic1+G*8
I used
G*8+Pic1

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #874 on: October 29, 2011, 05:51:00 pm »
Oh, that would do it XD Those are very very different, because Axe does its math from left to right and IGNORES pemdas!  So the first did (Pic1+G)*8, while the second does ( G*8 )+Pic1
« Last Edit: October 29, 2011, 05:51:07 pm by Builderboy »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #875 on: October 29, 2011, 05:55:01 pm »
Oh yeah... AXE, Y U NO DO ORDER OF OPS?
« Last Edit: October 29, 2011, 05:55:34 pm by epic7 »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #876 on: October 29, 2011, 06:15:40 pm »
Axe does its math from left to right and IGNORES pemdas!
But Axe is good friends with lambdas ;D
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #877 on: October 29, 2011, 07:11:39 pm »
Appvars.. again :D

I don't know why, but when i compile the following code, and I run the program:
-first time, the appvar doesn't exist => code 1
-second time, the appvar exists => code 2
It's okay, that's what I want it to do.
But after the second time, it doesn't do anything ??? it just skips this part of the code...

Code: [Select]
!If GetCalc("appvTLKC",Y0
GetCalc("appvTLKC",6)->K             // Code 1
sub(MOD                             //
Else
Repeat M=6               //
0->M            //  Code 2 
sub(SA         //
sub(CM        //
End
End

Spoiler For the whole code:
Code: [Select]
.TILOCK
DiagnosticOff
ClrHomeClrDraw^^r
Fix 5

sub(Z

!If GetCalc("appvTLKC",Y0
GetCalc("appvTLKC",6)->K
sub(MOD
Else
Repeat M=6
0->M
sub(SA
sub(CM
End
End

.MENU

[0000070F0C0C0C1F->Pic1
[0000C0E0606060F0
[3F3F3F3F3F1F0000
[B8389838F8F00000

ClrDraw^^r

Rect(11,14,74,35
RectI(13,16,70,31
Rect(14,17,68,29
RectI(15,18,66,27
Text(17,19,"Turn off
Text(17,28,"Change my code
Text(17,37,"Quit to homescreen
19->B
16->H
4->K
fnInt(FD,6

RectI(16,B,64,7
Repeat getKey(54)
If getKey(1)+getKey(4)
RectI(16,B,64,7
B<37*getKey(1)-(B>19*getKey(4))*9+B->B
RectI(16,B,64,7
While getKey(0)
Pause 5
End
End
If getKey(54)
If B=19
Text(0,,"1
End
If B=28
Text(0,,"2
End
If B=37
Text(0,,"3
End
End
End
FnOff

Archive "appvTLKC"
LnReg
Fix 4
Return


.SAISIE DU CODE
Lbl SA
Data(0,0,0,0,0,0)->GDB0
For(theta,0,20
ClrDraw
Rect(29,45-theta,37,20
RectI(31,47-theta,33,16
Rect(48-theta,9,38,11
Rect(49-theta,10,38,11
RectI(49-theta,10,36,9
If Z
Text(21-theta,1,"Choose your new code :"
Else
Text(21-theta,1,"Please enter your code:"
End
DispGraph
End


For(theta,0,9
Text(theta>4*~5+theta*7+32->L,theta>4*9+27,theta>Dec
Line(L+4,27,L+4,44
Line(L+5,27,L+5,44
End

Line(31,34,64,34
Line(31,35,64,35
0->C+26->B+4->A
RectI(A,B,7,9

Repeat getKey(15)
If getKey
RectI(A,B,7,9
A<58*getKey(3)-(A>30*getKey(2))*7+A->A
B=26*getKey(1)-(B=35*getKey(4))*9+B->B
RectI(A,B,7,9
If getKey(56)
0->C
DrawInv
Rect(33,11,28,6
DrawInv
End
If getKey(54)
Text(C*5+33,11,B=35*5+(A-30/7)->D>Dec
D->{GDB0+C
C+1->C
End
End
DispGraph
ReturnIf C=6
End
Return



.MODIFICATION
Lbl MOD
1->Z
sub(SA
Copy(GDB0,K,6
sub(Z
sub(H
ClrDraw
Return



.VERIFICATION DU CODE
Lbl CM
For(theta,0,5
(({GDB0+theta})=({Y0+theta}))+M->M
End
sub(H

Data(44,40)->Pic1FP
[00003A00000001E1900000079764000000719A00
[002DFEB500002E688980002207B2800069DE6D80
[00A803C2C00097DC9C40066233F7E006DF07F960
[0F661C96A00D99E32D501E271CDEA02963F36760
[34260C9D503B45F36AA03CB70C95602969FB6D60
[46A90D2A502AD5F2EA40151776AAE014AAD52A40
[0AA12B6BC0A955EAB90084543545405457CF5140
[122852AB00255DB54E000AAE856D00154A440800
[AAB1EBB500152CAA9800202612B600149A4DF000
[0812B540000865382000082A0A80000212A80000
[02A4040000010850000000128000000000000000
Bitmap(28,5,Pic1FP

Text(0,57,"Scanning...
For(theta,4,45
RectI(25,theta,43,5
Text(75,57,theta-3*100/42>Dec,37>Char
DispGraph
RectI(25,theta,43,5
Pause rand^250+50
End

!If M=6
Fix 3
Rect(0,17,96,15
Text(33,18,"WARNING !
Text(23,24,"Access denied
DispGraph
Fix 2
Repeat getKey
End
End
ClrHomeClrDraw
Return


.INITIALISATION DE Z
Lbl Z
0->Z
Return



Lbl H
For(theta,0,95
Horizontal -
DispGraph
End
Return



.FOND MENU
Lbl FD
DS>(K,4)
DS>(H,16)
End
End

For(C,0,4
For(A,0,5
Pt-Off(A*16,C*16-H,Pic1)^^r
Pt-Off(A*16+8,C*16-H,Pic1+8)^^r
Pt-Off(A*16,C*16+8-H,Pic1+16)^^r
Pt-Off(A*16+8,C*16+8-H,Pic1+24)^^r
End
End
DrawInv ^^r
Rect(11,14,74,35)^^r
DrawInv ^^r
DispGraph^^r
Return
« Last Edit: October 29, 2011, 07:12:07 pm by Wellen »
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #878 on: October 29, 2011, 07:14:48 pm »
I think the first line GetCalc(Name,Y1) returns 0 if the file does not exist, OR if the file is in RAM.  This may not be true though, it doesn't specify in the documentation D: Try archiving the file and see if it works

EDIT: nevermind, it should return true whether or not it is archived or not.  What version of Axe are you using?
« Last Edit: October 29, 2011, 07:16:25 pm by Builderboy »

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #879 on: October 29, 2011, 07:19:17 pm »
The appvar is archived at the end of the program..

I'm using 0.5.0
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #880 on: October 29, 2011, 07:19:56 pm »
Oh really?  Try upgrading to 1.0.5 first, maybe that will help fix some things and then we can go from there

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #881 on: October 29, 2011, 07:34:53 pm »
I tried to update to 1.0.5, but it does weird things ^^" I guess that's because 0.5.0 and 1.0.5 are very different, right ?
0.5.3b doesn't change anything compared to 0.5.0
« Last Edit: October 29, 2011, 07:36:46 pm by Wellen »
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #882 on: October 29, 2011, 07:51:09 pm »
The only difference is 1.0.5 has more features, everything should be backwards compatible o.O What kind of 'weird things' happen?

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Axe Q&A
« Reply #883 on: October 30, 2011, 04:59:33 am »
Here are two screenshots :
0.5.0 / 0.5.3


1.0.5 : it seems that the picture that scrolls fast a the beginnig is the menu picture.. So it doesn't even ask for the code, but the appvar is created ??? And RAM Cleared, wtf ???

« Last Edit: October 30, 2011, 05:00:28 am by Wellen »
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #884 on: October 30, 2011, 06:00:55 am »
Hmm strange, could you post the source as an 8xp file so I can test in in wabbit myself?  There definitely are some interesting things going on here.