Author Topic: DoodleJump Discussion  (Read 95135 times)

0 Members and 1 Guest are viewing this topic.

Offline turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #60 on: January 06, 2011, 09:52:04 pm »
Thanks for that. This really helps me to understand axe's syntax a bit better. I've been looking at the demos(and ztrumpet's snake), but haven't been making much progress yet.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #61 on: January 06, 2011, 10:12:19 pm »
I thought the hardest part to get used to in Axe was the concept of pointers.

Anyway, if you need help with anything, just ask  :)
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #62 on: January 06, 2011, 10:16:09 pm »
pointers, yeah. also finding all of the special chars. They're not alphabetical in the catalog. I know why, but it's still annoying.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Projectile motion, sound, doodlejump
« Reply #63 on: January 07, 2011, 06:41:55 pm »
I thought the hardest part to get used to in Axe was the concept of pointers.

Anyway, if you need help with anything, just ask  :)
Yeah, although I got more troubles with appvars. The syntax is just too confusing to remember. I had troubles understanding pointers too, but far less much than figuring out appvars + remembering the syntax for creating it, storing into it and pointing to it. And yeah the tokens are not in alphabetical order, otherwise Axe would most likely be an  additional 16 KB larger, kinda like language localization apps.
« Last Edit: January 07, 2011, 06:43:04 pm by DJ Omnimaga »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #64 on: January 07, 2011, 08:30:46 pm »
It was also somewhat difficult for me to create appvars too, although after I realized that the syntax for using L1 and appvars were identical, storing to them became easy.
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 DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Projectile motion, sound, doodlejump
« Reply #65 on: January 09, 2011, 07:16:14 pm »
My confusion always comes from figuring out when to use both syntaxes. I always end up using the code for pointing to an appvar to create it instead of the one to create it. I just never can remember which one to use. Result: when recalling data it is usually offset and in case of pics/sprites it sometimes just shows garbage. It is also one of the reason why I quit Axe after my futile attempt at creating a tilemap editor.

Offline Mohammad

  • Project Author
  • LV3 Member (Next: 100)
  • ***
  • Posts: 95
  • Rating: +23/-8
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #66 on: January 11, 2011, 10:14:03 pm »
posted newest update...(go to first ever post)
still havent made appvarring
« Last Edit: January 11, 2011, 10:14:26 pm by Mohammad »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Projectile motion, sound, doodlejump
« Reply #67 on: January 11, 2011, 10:18:02 pm »
Very nice update! I hope you can figure out the appvar stuff soon.

Offline Mohammad

  • Project Author
  • LV3 Member (Next: 100)
  • ***
  • Posts: 95
  • Rating: +23/-8
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #68 on: January 11, 2011, 10:38:15 pm »
Very nice update! I hope you can figure out the appvar stuff soon.
yep when i get time....finals :) need to keep my gpa lol

Offline Mohammad

  • Project Author
  • LV3 Member (Next: 100)
  • ***
  • Posts: 95
  • Rating: +23/-8
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #69 on: January 23, 2011, 06:54:11 pm »
been trying to get the appvar running...and i succesfully did, but i cant figure out how to compare its value to a different variable and change it if the variable is bigger than the appvar...im confused

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #70 on: January 23, 2011, 07:35:53 pm »
I'm assuming that you want to change the value in the appvar if your variable is larger then the one in the appvar?

Then try this:

Code: [Select]
.TEST

"appvSTUFF"->Str1
!If getCalc(Str1)->A
    getCalc(Str1,10)->A
End
I've done one of two things here -- I've either created an appvar named STUFF that's 10 bytes long, or if I already created that appvar sometime in the past, I've just found the pointer or address that tells me where the appvar starts.

Code: [Select]
1->{A}
2->{A+1}
3->{A+2}
5->{A+3}
8->{A+4}

3->C
The appvar is 5 bytes long - I've stored the numbers 1, 2, 3, 5, and 8 to the appvar.  I've also stored a random number to the variable C.

Code: [Select]
For(Z,0,4)
    If {A+Z}<C
        C->{A+Z}
    End
End
An appvar is just like a list in TI-Basic - The For loop runs through numbers zero through four, and the If statement checks items zero through four in the appvar to see if it's lower then C.  If it is, it writes whatever is in C to that item in the appvar.

Code: [Select]
For(Z,0,4)
    Text(5,Z*10,{A+Z}>Dec)
End
This runs through the entire appvar, displaying the new values.  This is what you should see:
3
3
3
5
8
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 Mohammad

  • Project Author
  • LV3 Member (Next: 100)
  • ***
  • Posts: 95
  • Rating: +23/-8
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #71 on: January 24, 2011, 12:33:52 am »
sorry, this may be really stupid question...but you state that STUFF is 10 bytes long but you then say its 5??
also can you just lose the for loops if you only use the appvar to store 1 single number(just the high score) Like this:
:GetCalc(Str1,2)->A
:if A<S:S->{A}:end
:GetCalc(Str1)->A
:Text(1,1:Text A:Dispgraph

the prob is this doesnt work and i dont know why....but then again im lazy and didnt type your code in...i will soon cause i know it works....

also..off topic...when you did Z*10...cant you just do 10z? also, in ti basic zooming out and in is possible which allows for zooming in\out through sniper scope (using plots as sprites)...but how can i do this in axe because ti basic is far too blinky

Thanks a lot for your help!!!!!!
« Last Edit: January 24, 2011, 12:38:59 am by Mohammad »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #72 on: January 24, 2011, 12:54:23 am »
sorry, this may be really stupid question...but you state that STUFF is 10 bytes long but you then say its 5??
Absolutely.  You can make your appvar 5 bytes long, 20 bytes, 1337 bytes... just change the 2nd value in getKey to the desired length.


Quote
also can you just lose the for loops if you only use the appvar to store 1 single number(just the high score)
Yup.
Try this:
Code: [Select]
"BLARG"->Str1
getCalc(Str1)->A
!If A
    getCalc(Str1,5)
End
.The above just either creates or finds an appvar named BLARG that is 5 bytes long

If {A}<S
    S->{A}
End
.If the value stored in the first byte of your appvar is less then S,
.Store S to the first byte of the appvar

Text(1,1,{A}>Dec)
.This is fairly simple - it displays the value.
.>Dec is the token in the math menu - in TI-Basic, it would turn a number into a decimal

Repeat getKey(15)
End
.Waits for the user to press [CLEAR]


Quote
Like this:
:GetCalc(Str1,2)->A
:if A<S:S->{A}:end
:GetCalc(Str1)->A
:Text(1,1:Text A:Dispgraph
the prob is this doesnt work and i dont know why....but then again im lazy and didnt type your code in...i will soon cause i know it works....

Thanks a lot for your help!!!!!!
There are several reasons why that won't work:

Code: [Select]
If A<S
    S->{A}
End
A is the location of your appvar.  Imagine your calculator has 100 sort of boxes (which represent a byte of memory), and each box can store one number. 
If we want find a box and use the number we put in there, we first have to know which box to look for. 
Luckily, the calculator numbers the boxes from 0 to 99, so we just have to remember what number box our number is in. 
'A' tells you which box to look for,
'{A}' opens that box and gives you the number inside.
This means that you shouldn't do
If A<S
but instead you should do
If {A}<S

Code: [Select]
:GetCalc(Str1)->A
:Text(1,1:Text A:Dispgraph

The 'getCalc(Str1)->A' is unnecessary.  You already know which box to look for, so you don't need to tell Axe to find the appvar again.

Again, you would need 'Test {A}', not 'Test A'.  Don't forget the >Dec token to prevent gibberish from being displayed.

If you don't begin your program with 'Mode 5' (and later end your program with 'Mode 4'), DispGraph is just going to overwrite your text.
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 Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #73 on: January 24, 2011, 12:54:59 am »
I haven't tested it myself, but perhaps try this? This first checks if the variable exists. If it doesn't, it creates it and initializes the high score (the first and only 2 bytes of the variable) to 0. After having created the variable if necessary, it then sets the high score to the maximum of the previous high score and S. This also sets V to point to the appvar, in case you want to grab the high score or any other data stored in it at a later time.

Code: [Select]
Text(1*256+1)
!If GetCalc(Str1)
→{GetCalc(Str1,2)}ʳ
-1
End
→V
max({}ʳ,S)→{V}ʳ
-1
Text {}ʳ►Dec


EDIT: Tested it and it works. It's about as optimized as I could get it. I can't see any other ways to optimize it without compromising your ability to use the appvar to contain other data as well.
« Last Edit: January 24, 2011, 01:16:51 am by Runer112 »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Projectile motion, sound, doodlejump
« Reply #74 on: January 24, 2011, 12:57:23 am »
o.0

For some reason, I find the abuse of HL to be insanely cool.

(I think it's HL...)
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.