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

0 Members and 6 Guests are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #810 on: October 25, 2011, 07:10:33 am »
That makes sense. It looks like you could store L1 as a variable like J and then use {J} later on.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axe Q&A
« Reply #811 on: October 25, 2011, 03:28:24 pm »
not sure what you mean.

if you mean this...
"It looks like you could store L1 as a variable like J and then use {J} later on."
then No. L1 is a constant number, but you can use it's location {L1} as a variable.
____________________________________________________________________________________

if you mean this...
"It looks like you could store L1 to a variable like J and then use {J} later on."
then i would say...

well you don't need to.  L1 is a constant. (34540 if i remember correctly), I would suggest you just keep using L1.
So you can do stuff like this for further locations: {L1 + J}
« Last Edit: October 25, 2011, 03:31:19 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe Q&A
« Reply #812 on: October 25, 2011, 06:00:00 pm »
Well, happybobjr, you can store A*10+1+L1 or whatever into J and then do {J} and it will do the same thing as {A*10+1+L1}, just easier to type.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #813 on: October 25, 2011, 06:48:58 pm »
If you stored
{A*10+1+L1}
into J, would {J+1} be the same as {A*10+2+L1}?

Also, in
PtOn(x,y,Pic1)

If pic1 is an 8x8 sprite, what part of the sprite is located exactly at x,y?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Q&A
« Reply #814 on: October 25, 2011, 07:10:32 pm »
Quote
If you stored
{A*10+1+L1}
into J, would {J+1} be the same as {A*10+2+L1}?
No.
Quote
Also, in
PtOn(x,y,Pic1)

If pic1 is an 8x8 sprite, what part of the sprite is located exactly at x,y?
Top left corner of that sprite block.
Sig wipe!

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 #815 on: October 25, 2011, 08:26:08 pm »
Quote
If you stored
{A*10+1+L1}
into J, would {J+1} be the same as {A*10+2+L1}?
No.
What he means by that is you'd store A*10+1+L1 into J, not {A*10+1+L1}.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #816 on: October 25, 2011, 08:28:33 pm »
Understood :)
« Last Edit: October 25, 2011, 08:28:48 pm by epic7 »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #817 on: October 27, 2011, 07:09:01 pm »
What is the adantage of using a shell?

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Q&A
« Reply #818 on: October 27, 2011, 07:22:37 pm »
The advantage of compiling a program to run in a shell?
I'm not too sure myself, but...

1. You can give your Axe program an icon and a description that will appear when you look at it in a shell
2. DoorsCS programs can be slightly larger (by about 700 bytes, I think) then the normal maximum (although you can use Crabcake and circumvent the entire issue of memory altogether)
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #819 on: October 28, 2011, 06:29:39 pm »
Is there any way to make this work? I need it for a game where the character can level up and then have different appearances.

Code: [Select]
If G=1
[hexadecimal]->Pic1
ElseIf G=2
[different hexadecimal]->Pic1
ElseIf G=3
[different hexadecimal]->Pic1
ElseIf G=4
[different hexadecimal]->Pic1
ElseIf G=5
[different hexadecimal]->Pic1
Else
[different hexadecimal]->Pic1
end


Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axe Q&A
« Reply #820 on: October 28, 2011, 06:31:37 pm »
yes there is.

you need to do
[00000000000000000000000]->Pic1
then do

If g=#
[##################]->{Pic1}
elaseif g=#
[##################]->{Pic1}

.....
and so on
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

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 #821 on: October 28, 2011, 06:41:37 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

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Q&A
« Reply #822 on: October 28, 2011, 06:52:02 pm »
That will work? What does the *8 do?

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 #823 on: October 28, 2011, 06:53:39 pm »
It increases the pointer by 8 bytes, since each sprite is only 8 bytes, it will move the pointer from the first sprite to the sprite after it.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Q&A
« Reply #824 on: October 28, 2011, 06:57:18 pm »
What Builderboy's code is essentially doing is hardcoding in a list (technically a contiguous block of memory) containing data for a sprite.  Each sprite takes up exactly 8 bytes.

Edit: Ninja'd
« Last Edit: October 28, 2011, 06:57:31 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.