Author Topic: Help with Menu  (Read 3268 times)

0 Members and 1 Guest are viewing this topic.

Offline Thundermagnet

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +9/-0
  • Thundermagnet Productions
    • View Profile
Help with Menu
« on: November 09, 2011, 05:26:07 pm »
This menu is messed up!  It is going to be for Saintrunner's Mario Shotgun, but it only displays a box that says: "Quit."  I am attempting to make it like the menu in the game Tank.  If someone feels like taking the time to fix this, please do!
This is the menu:

:"Play"=>Str901
:"About"=>Str902
:"Help"=>Str903
:"Quit"=>Str904
:4=>X
:0=>V=>W
:Fix 5
//Ignore the Vs and Ws!  They are there so I can shift the whole thing around.
:Line(V,W,V+21,W)
:Line(V,W,V,W+8)
:Line(V,W+8,V+21,W+8)
:Line(V+21,W,V+21,W+8)
:Text(V+2,W+1,Str901)
:Repeat getKey(54)
:If getKey(2) and X>1
:X-1=>X
:sub(PT)
:End
:If getKey(3) and X<4
:X+1=>X
:sub(PT)
:End
:DispGraph
:End
//End Main Loop
:Lbl PT
:If X=1
:Text(V+2,W+1,Str901)
:End
:If X=2
:Text(V+2,W+1,Str902)
:End
:If X=3
:Text(V+2,W+1,Str903)
:End
:If X=4
:Text(V+2,W+1,Str904)
:End
:Return

That was fun to write.  There is probably a way to do that faster.   ._.
« Last Edit: November 09, 2011, 05:30:21 pm by Thundermagnet »
Look me up on iTunes!  =D

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Help with Menu
« Reply #1 on: November 09, 2011, 05:28:05 pm »
I'm assuming => means store?
and it is supposed to be sub(X D)
it put an emoticon :P

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Help with Menu
« Reply #2 on: November 09, 2011, 05:29:12 pm »
ORDER OF OPERATIONS!!!11!1!!one!!

Instead of:

Code: [Select]
:If getKey(2) and X>1
:X--
:End

write:


Code: [Select]
:If getKey(2) and (X>1)
:X--
:End

That will probably help you. Axe uses left to right order of operations, in everything, always! And as for transcribing the code, you can download Croquette, I think there's a thread in a link in ephan or michael_lee's sig about it, and it opens calc source files and you can copy paste it into here.
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 Thundermagnet

  • LV3 Member (Next: 100)
  • ***
  • Posts: 69
  • Rating: +9/-0
  • Thundermagnet Productions
    • View Profile
Re: Help with Menu
« Reply #3 on: November 09, 2011, 05:35:32 pm »
I would say I love you but that would be weird.
Thank you sooooo much, this has fixed the problem.
Before I posted:  :banghead:
After I posted:   ;D
Look me up on iTunes!  =D

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Help with Menu
« Reply #4 on: November 09, 2011, 11:07:34 pm »
Try this :P

Code: [Select]

:"Play"=>Str901
:"About"=>Str902
:"Help"=>Str903
:"Quit"=>Str904
:Data(Str901{r},Str902{r},Str903{r},Str904{r})→Str90
:0→V→W+4→X
:Fix 5

:Line(V,W,V+21,W)
:Line(V,W,V,W+8)
:Line(V,W+8,V+21,W+8)
:Line(V+21,W,V+21,W+8)
:Text(V+2,W+1,Str901)

:Repeat getKey(54)
:If X>1 and getKey(2)
:X--
:sub(PT)
:End
:If x<4 and getKey(3)
:X++
:sub(PT)
:End
:DispGraph
:End

:Lbl PT
:Text(V+2,W+1)
:Text {X-1*2+Str90}{r}
:Return
In-progress: Graviter (...)