Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Aichi on September 26, 2010, 12:10:35 pm

Title: Need help by storing and loading something from free RAM
Post by: Aichi on September 26, 2010, 12:10:35 pm
Hi Omnimaga Community,
I'm working on my first Axe prog. I started it as the Axe example AXESDEMO
and added a shoot and pause feature, but there is some trouble by
storing new shoots into into L1 (savesscreen).
Code: [Select]
ClrDraw
DrawInv
For(A,0,63
sub(D
End
L1->B
For(H,0,29
0->{B+H}
End
ClrHome
43->X
Repeat XøX
sub(D
sub(U
DispGraph
sub(U
If getKey(2) and (Xø1
X-1->X
End
If getKey(3) and (Xø87
X+1->X
End
If getKey(54) and (T=0
For(H,1,9
!If {B+3*H}
1->{B+3*H}
X->{B-1+3*H}
55->{B-2+3*H}
15->T
Goto G
End
End
End
Lbl G
T=0+T-1->T
For(H,1,9)
If {B+H*3}
{B-2+H*3}-1->{B-2+H*3}
!If {B-2+H*3}
0->{B+3*H}
End
End
End
If getKey(55)
Fix 3
Text(37,19,"Pause
Text(20,26,"ENTER) CONTINUE
Text(27,33,"CLEAR) QUIT
Repeat getKey(9)
If getKey(15)
Goto Z
End
End
End
End
ClrDraw
ClrHome
Return
Lbl D
Vertical +
If rand^16
Pxl-Off(rand^96,1
End
Return
Lbl U
Pt-Change(X,55,Pic1
For(H,1,9)
If {B+H*3}
Pt-Change({B-1+H*3},{B-2+H*3},Pic2)
End
End
Return
Lbl Z
Fix 0
What happened:
(http://img3.imagebanana.com/img/5gncopwf/anigif.gif)
Does anyone know where my mistake is?
Regards,
Aichi
Title: Re: Need help by storing and loading something from free RAM
Post by: _player1537 on September 26, 2010, 12:16:11 pm
Would you mind moving the code out of the spoiler block?
Title: Re: Need help by storing and loading something from free RAM
Post by: Deep Toaster on September 26, 2010, 12:29:54 pm
Yeah, it's really tiny :P

Nice screenshot, though.
Title: Re: Need help by storing and loading something from free RAM
Post by: squidgetx on September 26, 2010, 12:36:32 pm
um, didn't look too closely at your code, but judging by the screenie, you didn't set a limit to the x and y values of the laser. So they kept increasing (and getting drawn off screen), and when they reached 255, they reset to 0 (this is why they appeared then on the other side)
Title: Re: Need help by storing and loading something from free RAM
Post by: Aichi on September 26, 2010, 12:37:12 pm
@ _player1537
Better? :)

@ Deep Thought
It would be nicer, if the shoots on the screenshot do not activate by themself. :)

Edit:
@ quidgetx
The shoots will be deleted, if position y of a shoot reaches 0 (On start of Lbl G).
But Im wondering about the main problem: The shoots appear without shooting (getkey=54) and move back one pixel on X per frame. ._.
Title: Re: Need help by storing and loading something from free RAM
Post by: Deep Toaster on September 26, 2010, 12:43:42 pm
Haven't read all of the code yet, but let's see... Did you remember that Axe has no order of operations? Meaning that
B+H*3
is actually
(B+H)*3?
Title: Re: Need help by storing and loading something from free RAM
Post by: squidgetx on September 26, 2010, 12:45:37 pm
ok looked at it a bit more closely but this
Code: [Select]
!If {B+3*H}
1->{B+3*H}
X->{B-1+3*H}
55->{B-2+3*H}

is the same as
Code: [Select]
!If {B+3*H}
1->{B+3*H}
X->{B+2*H}
55->{B+1*H}

remember, Axe does order of operations left to right, ignoring conventional algebra styles.

What I think you want is
Code: [Select]
!If {H*3+B}
1->{H*3+B}
X->{H*3+B-1}
55->{H*3+B-2}



Title: Re: Need help by storing and loading something from free RAM
Post by: Deep Toaster on September 26, 2010, 12:46:36 pm
^This.

I made that same mistake once every few weeks :P But really, the way Axe does it is a good idea. Saves a lot of memory that way.
Title: Re: Need help by storing and loading something from free RAM
Post by: _player1537 on September 26, 2010, 12:56:31 pm
Teehee, everyone is copying me :)  I made something very similar :P  And with the same method of having bullets on or off :)

Looks very nice so far ^^  G'luck :)
Title: Re: Need help by storing and loading something from free RAM
Post by: Deep Toaster on September 26, 2010, 12:59:18 pm
Teehee, everyone is copying me :)  I made something very similar :P  And with the same method of having bullets on or off :)

Looks very nice so far ^^  G'luck :)

Let that be a tribute to your great coding skills :D

Oh, and Aichi, try not to leave closing parentheses off in Axe. It can occasionally cause problems, unlike in BASIC.
Title: Re: Need help by storing and loading something from free RAM
Post by: Aichi on September 26, 2010, 01:16:06 pm
I put the 'H*3' to the front and that solved the problems.
Thank you guys! ^-^
Title: Re: Need help by storing and loading something from free RAM
Post by: DJ Omnimaga on September 26, 2010, 01:18:38 pm
Glad to hear this is solved. I am curious what you will come up with (as game) when there is some more progress :D
Title: Re: Need help by storing and loading something from free RAM
Post by: Hot_Dog on September 26, 2010, 01:19:51 pm
And that is a sweet screenie
Title: Re: Need help by storing and loading something from free RAM
Post by: Deep Toaster on September 26, 2010, 02:03:03 pm
Yep. Nice ship, btw.
Title: Re: Need help by storing and loading something from free RAM
Post by: ztrumpet on September 26, 2010, 02:25:31 pm
Looks like a nice screenie.  Good luck. :)
Title: Re: Need help by storing and loading something from free RAM
Post by: Deep Toaster on September 26, 2010, 02:28:16 pm
You know, the Axe Documentation/Commands List should remind users of that in more places. Maybe a feature request...
Title: Re: Need help by storing and loading something from free RAM
Post by: Aichi on September 30, 2010, 09:47:21 am
(http://img3.imagebanana.com/img/lo06orik/aichi.gif)
Hope it isnt a problem if I post a project progress screen in this thread. :P
Regards
Aichi
Title: Re: Need help by storing and loading something from free RAM
Post by: Raylin on September 30, 2010, 10:11:42 am
Interesting. Phoenix in Axe.
I shall be watching this closely from here on out.
Title: Re: Need help by storing and loading something from free RAM
Post by: DJ Omnimaga on September 30, 2010, 05:34:11 pm
WOW this is amazing! You should post a new thread about it too. I am sure a lot of people would like it, noticing the attention Raven got. Raven was another similar game in the works by _player1537 but he discontinued development to move to TI-Nspire stuff :(
Title: Re: Need help by storing and loading something from free RAM
Post by: ztrumpet on October 01, 2010, 04:20:28 pm
Awesome!  That's a really cool looking game!  If you want, I can split the topic from that post and make a new thread. :)

That looks amazing.  Nice job! ;D
Title: Re: Need help by storing and loading something from free RAM
Post by: Aichi on October 01, 2010, 04:37:32 pm
@ ztrumpet
Thanks for the laud. ^^
You dont need  move the last posts from here.
I will post a new thread when I release the Beta version soon.
Regards,
Aichi
Title: Re: Need help by storing and loading something from free RAM
Post by: DJ Omnimaga on October 01, 2010, 04:39:49 pm
I can't wait for a version to try :D