Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ThatTreeOverThere

Pages: [1]
1
Axe / Re: Drawing from 2-byte positions
« on: March 24, 2013, 12:42:42 pm »
EDIT: I'm an idiot, I left the conditional commented for testing and uncommented it when I wanted to change it :P
It works now, thanks so much guys :)
(Original message)
MGOS: I tried that, or at least something similar:

Quote from: Code
:For(I,0,S
:I*2*2+B→r6
:{r6}^r^+X→r1
:{r6+2}^r^+Y→r2
:.If r1≥≥0?r1<<96?r2≥≥0?r2<<64
:Pt-On(r1,r2,Pic1
:.End
:End

2
Axe / Re: Ti Basic to Axe
« on: March 24, 2013, 09:09:08 am »
Dreeass: you can store whatever you want, wherever you want. However, if you store something into the TI-OS RAM area or some other unsafe place, or you treat a pointer as an integer or a fixed point number as a float or even a signed as an unsigned, you get no warnings. Everything will just break or act unexpectedly. Java and TI-Basic are at least nice in that respect, but you get something more like C here. (and a good thing too, it's faster :) ) I recommend writing down what you're storing and where.

3
Axe / Re: Drawing from 2-byte positions
« on: March 24, 2013, 08:51:39 am »
Xeda:
I feel like 1 byte for position is too limiting... even though I could be wrong and am just overlooking a better way to make a slightly more "open-world" game :P Also right now they're unsigned, but I can work with that. Also I'm just testing everything out, there's not really that much written just yet.

Edit: Dang, didn't work with a bunch of comparisons to see if it's in screen space. Are comparisons 16-bit? (also I think I may just go back to 8-bit)

4
Axe / Re: Drawing from 2-byte positions
« on: March 24, 2013, 08:42:09 am »
So I need to check if the sprite is in a certain position... So I'll check if each coordinate is greater than 0 but less than the screen size in that direction? Lemme try this out.

5
Axe / Re: Drawing from 2-byte positions
« on: March 24, 2013, 07:25:05 am »
So can you explain to me how I'm supposed to draw the sprites? Like using conditionals to say, "oh this is obviously not the correct 256*256 area that I'm supposed to draw in, let's not draw the sprite"?
I mean, all I have for code now are boxes and a camera system, it's basically all drawing from prewritten data. Runer, you can modify whatever you'd like, there's not much there yet :)
(Also if I could figure out how to post entire sources without retyping them...)
I'd like it to feel like an open world, if possible. I'd like to draw and store procedurally created buildings in a city (even though it may not be possible)

6
Axe / Re: Ti Basic to Axe
« on: March 23, 2013, 11:22:23 pm »
So to store something into RAM, you simply store into the memory location with a pointer (in code, X -> {L1+4} would store X to that value)

So instead of accessing something like L1(5), you access the fifth byte with {L1+4}. The other stuff carries over from TI-Basic, mostly, except that you're only storing a byte. If you want full 16 bit values (up to 65535) you simply add the r after the curly brackets like this: {L1+4}r
Also, one more thing. L1 is just a pointer to a free piece of RAM. It's not a list, and if you allocate more RAM for yourself or write into program data, you can use that too. I remember seeing something here about pointer arithmetic... see http://axe.eeems.ca/Documentation.pdf, page 13

7
Axe / Drawing from 2-byte positions
« on: March 23, 2013, 11:16:51 pm »
So I'm ThatTreeOverThere, new only in posting to the forums  :) , and I've been playing with Axe for a little while. I've run into an issue, though...
I'm making a top-down zombie shooter, and i'm having trouble drawing sprites exactly where I want them to go. I want to be able to store the positions of each zombie in 2 bytes per value (so, 4 bytes for X and Y together), but when I go to draw them on the screen, I suspect that Pt-On( converts my beautiful 16-bit numbers into 8-bit numbers and causes sprites to draw modulo 256, which is annoying!  >:(

The specific part in source looks like:

Code: [Select]
For(I,0,S
Pt-On({I*2*2+B}[sup]r[/sup]+X,{I*2*2+B+2}[sup]r[/sup]+Y,Pic1
End

Where S is the number of sprites-1, Pic1 is the sprite image pointer, B is a pointer to a list consisting of 2byte X and Y values (and I'll optimize out that last duplicate expression later :) )

So can anyone help me?

Pages: [1]