Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: willrandship on January 11, 2011, 06:40:39 pm
-
http://pastebin.com/pR57e81a (http://pastebin.com/pR57e81a)
This is giving me a headache. It's supposed to give me walls being drawn, getting progressively farther away, being detected off a pic, but It's not showing anything, probably due to a mistake in the formula that I can't find. :mad: :banghead:
Anyone have any helpful ideas/suggestions? even a completely new formula, I just want it to work.
-
I think the main part of your problem is that in this line of code:
If {PY*96+PX+(A*96)+GDB1+F}=1
I think you're trying to check bit by bit for the location of a wall, but when you access data using curly braces, it returns the value of the byte.
Also, try closing your parenthesis - leaving them open in Axe can cause issues.
Also, I didn't know that you could use variables created using more then one letter. Does that really work?
-
In axe it does I think (hope), unless the Pic1xX thing only applies to other variables. maybe that's the issue. I actually changed that = to a >= so it would work that way. I'll try changing it to just X and Y.
-
What's PY and PX? If you're trying to do P*Y and P*X, remember that Axe doesn't support implicit multiplication.
-
No, I was doing PY as one var and PX as one var. They are the player's coordinates on the pic var.
-
Try Y instead of PY and X instead of PX. I don't think Axe supports multiple letter variables like it does with static pointers.
-
That only works for static pointers becasue those don't take up any memory. I only have a limited number of variables because I want to leave users with enough free ram to play around with. If you need more variables, you can always use these ram locations manually: {L1+10}r for instance will act exactly the same as a regular variable (make that 10 any constant you want as long as it fits in ram)
-
Yeah, I tried with X and Y, no change at all. I also made sure that it was detecting something at one point, by forcing the If function.
-
Are you sure you changed all the PXs and PYs to Xs and Ys?
Also,
If {Y*96+X+(A*96)+GDB1+F}=1
would be a lot more optimized as
!If {Y+A*96+X+F+GDB1}-1
Taking out those parentheses in particular helps a lot :)
-
Umm, those two lines don't do the same thing.
Y+A*96 != Y*96+A*96
I tried it in my calc, no change :( The paste has the old, my calc has yours DT
And yes, I got all the PX's and PYs, they're only referenced in the one line anyways :P
By the way, an updated paste http://pastebin.com/TGSqGSJ8 (http://pastebin.com/TGSqGSJ8)
-
Umm, those two lines don't do the same thing.
Y+A*96 != Y*96+A*96
It's the same because there's no order of operations in Axe, remember. It goes strictly from left to right.
-
Deep Thought is right AFAICT.
"Y+A*96" evaluates as "(Y+A)*96", which is the same as "Y*96+(A*96)"
-
XCB doesn't multiply X by C by B?
Shocking news!: That's why many of the games I attempted never worked and kept giving me errors... I never thought it was this part of the code because I assumed it was OK.
-
Indeed, Axe doesn't have implicit multiplication. In fact, if you have, say, "ABC" in your code, it will evaluate just like C alone would, but more slowly. (Since it loads A, then B, and finally C) ;)
-
Indeed, Axe doesn't have implicit multiplication. In fact, if you have, say, "ABC" in your code, it will evaluate just like C alone would, but more slowly. (Since it loads A, then B, and finally C) ;)
I thought it loaded A. This is where the NSpire Basic wins: multiple character variables.
-
The 86 had it first, and its basic is faster :P
86 Basic you could load any 8 letter var (excluding commands) as any var type.
-
Indeed, Axe doesn't have implicit multiplication. In fact, if you have, say, "ABC" in your code, it will evaluate just like C alone would, but more slowly. (Since it loads A, then B, and finally C) ;)
I thought it loaded A. This is where the NSpire Basic wins: multiple character variables.
Nope, Axe does exactly what you type: It does the first operation (which just loads A), then the second (loading B), then the third.
-
The 86 had it first, and its basic is faster :P
86 Basic you could load any 8 letter var (excluding commands) as any var type.
Really? I thought Nspire Math BASIC was quite fast and only the display stuff were slow? That said, 86 BASIC was slower (http://www.youtube.com/watch?v=L6w6KnnyhdI) than on the 82, 83, 83+ and 85, though.
-
Well, true but at least it still had all the functions, like getkey, circle and output :P
But anyways, perhaps someone else could write me a function that does the following for my code.....
For walls ranging from left to right 12 sprites (F) and 4 sprites deep(A)
If Your position + the wall's position relative to you is on (in GDB1)
Draw a column That is at the correct F location, and that is A*8 pixels away from the top and bottom of the screen, using the picvar + the depth (for offset to other pics in mem, Pic1+A*16 or similar)
End
End
End
Dispgraph :P
That's what my code is supposed to do.
-
Aww, no one wants to make one for me? :'(