Join us on Discord!
You can help CodeWalrus stay online by donating here.

Axe Soccer

Started by SiphonicSugar, September 24, 2015, 09:28:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

c4ooo

Well actualy there are several things wrong  :-\

First of my code for movment is slightly bugged and will not prevent you from going bellow zero (and underflowing to the max cord).

Second of, the way the cordinate is calculated is wrong, and i failed to see it. Instead of doing "X_Render_At = X_Position + X", it should be "X_Render_At = X_Position - X". (notice the subtraction)

The last problem is that all drawing commands in axe accept signed bytes, meaning that instead of being a number 0 to 255 the number is -127 to 128. This way it will be hard to render such a long field, without using hackish clipping. (Basicly axe is thinking you want a line from 32 to -24 instead of 32 to 232, for example.

Ile see what i can come up with :P

SiphonicSugar

Okay, thanks!

Also, how did you learn so much about Axe?
  • Calculators owned: TI-89, TI-84 Plus, TI-92, TI-84 Plus C SE, and TI-Nspire CAS with Touchpad
I'm just trying to grab some inspiration. :P

c4ooo

Quote from: SiphonicSugar on September 29, 2015, 08:00:45 PM
Okay, thanks!

Also, how did you learn so much about Axe?

Well, i just spent a lot of time making demo games. Eventually, i started to have a basic understanding of how the language works under the hood, and knowing about the architecture of the CPU and the rest of the calc helped. (well..  i actualy know next to nothing about the architecture of the calc itself) But by being aware of the z80 architecture, i basicly understood about how the CPU is 8 bit (but contains 16 bit instructions) and the limitations it imposed and how to do bitmath etc etc... It still took me some time to grasp consepts such as signed numbers etc etc..

But, rant aside, it seems i got some working and optimized code for a 80*120 field :D Also keep in mind that although i know alot of axe concepts, people like @Runer112 know more ;) Basically this is the code i came up with:

.FOOTBALL ;)
[78848484847800]->Pic1
48->X
32->Y
Repeat getKey(15)
ClrDraw
Pt-On(46,30.Pic1
max(min(X+getKey(3)-getKey(2),76)^r,3)^r->X
max(min(Y+getKey(1)-getKey(4),196)^r,3)^r->Y
48-X->S
128-X->T
If y<33
HLine(32-Y->N,S,T
End
VLine(S,N,min(232-Y,127)^r->O)
VLine(T,N,O)
HLine(O,S,T
DispGraph
End

I may have made an error or two in copying the code, but it should work. Also note that this code uses the N,O,S and T vars.  :thumbsup:

SiphonicSugar

#18
Hmm... Pretty advanced stuff ya got there!  ;)

I'll learn to work with it!

I tried to compile it, and it gave me the error "WRONG # OF ARGS"
It went down to the first max( command... so I suspect that the second one is like that too.
  • Calculators owned: TI-89, TI-84 Plus, TI-92, TI-84 Plus C SE, and TI-Nspire CAS with Touchpad
I'm just trying to grab some inspiration. :P

Powered by EzPortal