Author Topic: Help with movement.  (Read 7570 times)

0 Members and 1 Guest are viewing this topic.

Offline Masinini

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +0/-0
    • View Profile
Help with movement.
« on: January 04, 2011, 08:01:06 pm »
So I decided to start learning axe, with my limited know how of the codes. I made a movement routine that ended up resetting my ram. Anyone have a movement routine that works and is not an unbreakable loop?
Output(1,1,"By the pricking of my thumb"
Txt(1,1, "Something wicked this way comes."

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Help with movement.
« Reply #1 on: January 04, 2011, 08:02:01 pm »
By movement, are you talking about simply moving around a sprite on the screen?

There's a thread around here talking about that...

edit: Here it is
« Last Edit: January 04, 2011, 08:02:38 pm by squidgetx »

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Help with movement.
« Reply #2 on: January 04, 2011, 08:18:02 pm »
Easy way to make a program not have an infinite loop:

First line of code (after description line)
repeat getKey(0) or getkey(15), for any key or for clear
your code
goes in
this area
end
that way, unless it actually crashes the calc, you can get out simply by pressing clear, or, any button if you used getkey(0)

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: Help with movement.
« Reply #3 on: January 05, 2011, 01:26:18 am »
I made a movement routine that ended up resetting my ram.

Get used to that :P It'll probably happen a lot more before you learn how not to [purposefully] reset your calc.

On a related note, never do Asm(C7 unless something freaks out the OS and you have no other way of shutting down the calc.
« Last Edit: January 05, 2011, 01:28:47 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Help with movement.
« Reply #4 on: January 05, 2011, 01:29:17 am »
What does Asm(C7 do? And is it done on the homescreen with Basic or Axe?

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: Help with movement.
« Reply #5 on: January 05, 2011, 01:32:13 am »
It's compiled with Axe (to RST $00) and it's basically a simulated RAM clear... with all of the fun [and data loss] of a real one.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Help with movement.
« Reply #6 on: January 05, 2011, 01:34:24 am »
just RAM right?, not Archive?

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: Help with movement.
« Reply #7 on: January 05, 2011, 01:35:36 am »
Yep.

I used it to shut down my calc awhile back when some OS hook failed and disabled the 2nd+On combination on my calc. Pulling the batteries didn't work either, so it was the only option. Yes, Axe saved my calc  ;D
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Help with movement.
« Reply #8 on: January 05, 2011, 07:12:27 am »
You could've done that in BASIC too: AsmPrgm: C7 then ran it from the homescreen with Asm()

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: Help with movement.
« Reply #9 on: January 05, 2011, 12:55:12 pm »
Nice trick to know, although I personally just go in the MEM menu. I guess it can be useful if a normal reset or ON+DEL fails

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Help with movement.
« Reply #10 on: January 05, 2011, 01:02:55 pm »
You know, if you can't get to the ram clear menu or are unable to clear your ram for some reason where taking out the batteries doesn't work, you can always take out the backup battery (which powers the ram) to guarantee a ram clear even if the calculator wasn't frozen.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Help with movement.
« Reply #11 on: January 05, 2011, 03:14:24 pm »
So I decided to start learning axe, with my limited know how of the codes. I made a movement routine that ended up resetting my ram. Anyone have a movement routine that works and is not an unbreakable loop?

Here -- try this:
Code: [Select]
.TEST

[FFFFFFFFFFFFFFFF]->Pic1
10->X->Y

Repeat getKey(15)
  ClrDraw

  getKey(3)-getKey(2)+X->X
  getKey(1)-getKey(4)+Y->Y

  Pt-On(X,Y,Pic1)

  DispGraph
End

(Of course, when you're typing this out on your calc, you don't need to add the indents or spaces)

The code should display a solid black square that moves around with the arrow keys -- press [CLEAR] to exit the program.
« Last Edit: January 05, 2011, 03:14:45 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.

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: Help with movement.
« Reply #12 on: January 05, 2011, 08:34:31 pm »
You know, if you can't get to the ram clear menu or are unable to clear your ram for some reason where taking out the batteries doesn't work, you can always take out the backup battery (which powers the ram) to guarantee a ram clear even if the calculator wasn't frozen.
For 1 minute, I assume, right? Because I removed all 5 batteries once, then immediately put them back, yet my RAM was still intact.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Help with movement.
« Reply #13 on: January 06, 2011, 09:08:31 pm »
You know, if you can't get to the ram clear menu or are unable to clear your ram for some reason where taking out the batteries doesn't work, you can always take out the backup battery (which powers the ram) to guarantee a ram clear even if the calculator wasn't frozen.
For 1 minute, I assume, right? Because I removed all 5 batteries once, then immediately put them back, yet my RAM was still intact.

Hmm, that's weird.  Were you on the homescreen when you pulled the batteries?  Because pulling the batteries while on the home screen doesn't cause a RAM clear -- you have to be running a program or something.
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 turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: Help with movement.
« Reply #14 on: January 06, 2011, 10:19:17 pm »
Ok. thanks for that, Michael_Lee. I'm also learning axe, and am planning on a short game involving movement. this helped a bit on understanding the syntax in general.