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

0 Members and 1 Guest are viewing this topic.

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1275 on: December 31, 2011, 11:52:30 am »
Wow, this is exactly what I needed - thanks!

But how can I handle the other possible keypresses? Should I change everything to getkey->K and check the other possibilities with the inData, or can I leave the getkey()?

This
Code: [Select]
Repeat getkey(15)
getkey->K
inData(K,Number-Possibilities)->N
if N<9 + N
do number stuff
elseif getkey(whatever)
do other stuff
elseif getkey(whatever)
do other stuff
End
End
Or that:
Code: [Select]
0->K
Repeat K=15
getkey->K
inData(K,All Possibilities)->N
if N<9 + N
do number stuff
elseif N=whatever
do other stuff
elseif N=whatever
do other stuff
End
End

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Q&A
« Reply #1276 on: December 31, 2011, 12:17:27 pm »
It depends.  What are you using this for?  If this is for a menu or text input, I'd go with getKey, but if this is for part of the main engine for a game I'd go with getKey(#) and make eight of them in If statements.

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1277 on: December 31, 2011, 12:32:32 pm »
It's more like an editor, so I think getkey->K is good for this. But if I used both functions, would they still work both fine?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Q&A
« Reply #1278 on: December 31, 2011, 01:05:52 pm »
It's more like an editor, so I think getkey->K is good for this. But if I used both functions, would they still work both fine?
They'd work fine, but I'd stick to one or the other for a more standard appearance.
I think getKey->K is the best solution too.

Good luck with the editor.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #1279 on: December 31, 2011, 01:37:21 pm »
Ok I have a feeling I'd be able to firgure this out myself, but it would prolly take a while since I don't remember much from math :P

Anyway, so I have a projectile flying at (S,T) with an angle, Z.  If Z is zero it faces straight down, 256 degrees, etc.
I have an enemy at, say, (X,Y).  How would I check which side of the projectile the enemy is on (right or left), related to the projectile's angle?
Vy'o'us pleorsdti thl'e gjaemue

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Axe Q&A
« Reply #1280 on: December 31, 2011, 02:06:55 pm »
Data(33,34,26,18,35,27,19,36,28,20)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1

Data(33,34,26,18,35,27,19,36,28,20,0)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1

Fixed.

Ok I have a feeling I'd be able to firgure this out myself, but it would prolly take a while since I don't remember much from math :P

Anyway, so I have a projectile flying at (S,T) with an angle, Z.  If Z is zero it faces straight down, 256 degrees, etc.
I have an enemy at, say, (X,Y).  How would I check which side of the projectile the enemy is on (right or left), related to the projectile's angle?
tan⁻¹(S-X,T-Y)-Z^256<128 should be true if the projectile needs to rotate in the positive direction.
tan⁻¹(S-X,T-Y)-Ze0 is optimized but returns the opposite.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Q&A
« Reply #1281 on: December 31, 2011, 02:25:52 pm »
Data(33,34,26,18,35,27,19,36,28,20)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1

Data(33,34,26,18,35,27,19,36,28,20,0)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1

Fixed.
Good catch.  Thank you!

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 #1282 on: December 31, 2011, 03:33:05 pm »
tan⁻¹(S-X,T-Y)-Z^256<128 should be true if the projectile needs to rotate in the positive direction.
tan⁻¹(S-X,T-Y)-Ze0 is optimized but returns the opposite.
If you had the X and Y velocity (we'll call A,B) instead of an angle, you could ditch the slow trigonometry and use cross products instead!

Code: [Select]
X-S*B-(Y-T*A)<<0

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: Axe Q&A
« Reply #1283 on: January 06, 2012, 10:14:36 pm »
How does Axe handle sprites whose lengths are greater than 16? For example, if I had [AA00AA00AA00AA0032BB32BB32BB32BB] would it be displayed horizontally as two sprites, vertically as two sprites, or some other way completely?

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #1284 on: January 06, 2012, 10:18:13 pm »
Pt-*() displays the next 8 bytes after the pointer.  So, if you wanted that to display them, one after the other, you would have to display it 8 bytes at a time:
[AA00AA00AA00AA0032BB32BB32BB32BB]→Pic1
.stuff, etc
Pt-On(X,Y,Pic1)
Pt-On(X+8,Y,Pic1+8)


« Last Edit: January 06, 2012, 10:18:32 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: Axe Q&A
« Reply #1285 on: January 06, 2012, 10:40:45 pm »
Ahh, okay. So [AA00AA00AA00AA0032BB32BB32BB32BB] is equivalent to [AA00AA00AA00AA00][32BB32BB32BB32BB]?

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 #1286 on: January 06, 2012, 10:57:20 pm »
If two calculators were connected via linkport and both running Axe programs, and 1 calculator wrote 1 into the Port, and the other wrote a 2 into the port, what would each calculator read the port as?  I know the result can be determined by some sort of binary combination of the two numbers but I can't remember which.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #1287 on: January 06, 2012, 11:07:01 pm »
So [AA00AA00AA00AA0032BB32BB32BB32BB] is equivalent to [AA00AA00AA00AA00][32BB32BB32BB32BB]?
Yes.
« Last Edit: January 06, 2012, 11:07:45 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Axe Q&A
« Reply #1288 on: January 07, 2012, 10:24:50 am »
If two calculators were connected via linkport and both running Axe programs, and 1 calculator wrote 1 into the Port, and the other wrote a 2 into the port, what would each calculator read the port as?
0

I know the result can be determined by some sort of binary combination of the two numbers but I can't remember which.
(A or B) xor 3 or equivalently 3-(A or B)

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Axe Q&A
« Reply #1289 on: January 08, 2012, 01:04:53 am »
Does axe have buffer support for text? Cause I can't do:

Code: [Select]
:Text(X,Y,"Stuff"[sup]r[/sup]
« Last Edit: January 08, 2012, 01:05:46 am by parser padwan »