Author Topic: Arrays in Axe (Enemy/Bullet Code Tutorial)  (Read 18461 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #15 on: February 22, 2011, 12:13:45 am »
That would be cool :D

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #16 on: February 22, 2011, 12:44:43 am »
Also make a tutorial for hit detection. I've never fully understood how to do it without checking every object and compare locations (or is that fastest way?)
In-progress: Graviter (...)

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #17 on: February 22, 2011, 01:53:47 am »
Thank you.  This is quite useful! :)
ld a, 0
ld a, a

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #18 on: February 22, 2011, 09:13:22 am »
Also make a tutorial for hit detection. I've never fully understood how to do it without checking every object and compare locations (or is that fastest way?)

Yeah, I just cycle through and test it with the character.




Offline ee511

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #19 on: February 25, 2011, 03:40:13 pm »
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #20 on: February 25, 2011, 04:17:00 pm »
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!

*cough*

How about showing us your code first?  That way, we know what to help you with.
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 Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #21 on: February 25, 2011, 04:18:33 pm »
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!

Crashes in Axe are going to be frequent as you learn, did you have everything backed up?  And as Michael_Lee said, we are going to have to see your code to help :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #22 on: February 25, 2011, 05:47:54 pm »
Yeah, ALWAYS backup (emphasis on always, and I mean backup every 3 minutes or so) on your computer while coding in Axe. Else you're gonna lose progress often. Also when asking help you should post code as Deep and Builderboy said, so we can see what could be wrong. Welcome on the forums btw!

Offline ee511

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #23 on: February 25, 2011, 05:50:42 pm »
well, when I was working on this project, it was the only thing in ram at the time, and i had axe set to auto backup.

Offline ee511

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #24 on: February 25, 2011, 07:06:16 pm »
it's a lot of code, but here you go!!

Code: [Select]
:.SAND
:ClrDraw
:ClrHome
:Fix 1
:Text(5,10,"Zen Sandbox")
:Fix 0
:Repeat getKey(9)
:End
:ClrDrawr
:0→L
:0→W
:10→F→G
:0→{L1}
:0→{L2}
:Repeat getKey(15)
: If W>0
:  For(J,0,W)
:   {2*J+L2}→B
:   {2*J+L2+1}→C
:   Pxl-On(B,C)
:  End
: End
: For(K,0,L)
:  {2*K+L1}→X
:  {2*K+L1+1}→Y
:  Pxl-Off(X,Y)
:  If pxl-Test(X,Y+1)
:   rand^2*2-1→A
:   !If pxl-Test(X+A,Y)
:    X+A→X
:   Else!If pxl-Test(X-A,Y)
:    X-A→X
:   End
:  Else
:   Y+1→Y
:   Lbl RE
:  End
:  If Y>63 and (L>1)
:   conj(K*4+L1+2,-2,L-1→L-K*4+1)
:   Pxl-Off(X,Y)
:   Goto ER
:  End
:  If X<0
:   95→X
:  End
:  If X>95
:   0→X
:  End
:  X→{2*K+L1}
:  Y→{2*K+L1+1}
:  Pxl-On(X,Y)
:  Lbl ER
: End
: Pxl-Off(F,G)r
: If getKey(1)
:  G+1→G
: End
: If getKey(2)
:  F-1→F
: End
: If getKey(3)
:  F+1→F
: End
: If getKey(4)
:  G-1→G
: End
: If getKey(54) and (L<200)
:  L+1→L
:  F→{L*2+L1}
:  G→{L*2+L1+1}
: End
: If getKey(55) and (W<200) and (not(pxl-Test(F,G)))
:  W+1→W
:  F→{W*2+L2}
:  G→{W*2+L2+1}
: End
: Pxl-On(F,G)r
: Fix 5
: Text(0,0,L►Dec)
: Fix 4
: DispGraphr
: If getKey(56)
:  For(B,0,L*2)
:   0→{L1+B}
:  End
:  0→L
:  For(B,0,W*2)
:   0→{L2+B}
:  End
:  0→W
:  ClrDraw
: End
:End
:ClrDraw
[/tt]
« Last Edit: February 25, 2011, 07:12:22 pm by ee511 »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #25 on: February 25, 2011, 07:11:33 pm »
Please don't use [code] tags in spoilers, it gets rendered into a tiny, tiny box in Chrome :( You can use [tt] instead. It's also fixed-width.

And try not to double-post within six hours. You can use the Quick Modify button at the bottom right of your post to add something.

Anyway, reading your code right now :)

EDIT: Is this your removal routine? conj(K*4+L1+2,-2,L-1→L-K*4+1)

You're using K*4 even though your elements are 2 bytes (I think).
« Last Edit: February 25, 2011, 07:14:36 pm by Deep Thought »




Offline ee511

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #26 on: February 25, 2011, 07:21:33 pm »
hee hee. whoops. let me fix that... yeah that doesn't work. it sort of shifts the screen over a bit, and then crashes the calculator... instead of crashing right away.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #27 on: February 25, 2011, 07:26:10 pm »
hee hee. whoops. let me fix that... yeah that doesn't work. it sort of shifts the screen over a bit, and then crashes the calculator... instead of crashing right away.

Sounds like you're Copy('ing too many bytes... Can you show me what you changed the removal routine to?




Ashbad

  • Guest
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #28 on: February 25, 2011, 07:27:20 pm »
hmm, reminds me of a tutorial I was writing to actually implement Java-styled OOP with Axe, with instances, classes, and a slight bit o' inheritance, along with attaching methods and such.  If you want I can give it to you DT.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
« Reply #29 on: February 25, 2011, 07:30:39 pm »
hmm, reminds me of a tutorial I was writing to actually implement Java-styled OOP with Axe, with instances, classes, and a slight bit o' inheritance, along with attaching methods and such.  If you want I can give it to you DT.

I was writing a version of that too O.o I stopped so I could try my hands at writing an OOP Axiom. I failed at that too :P