Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: obon7 on November 27, 2011, 11:35:13 pm
-
Can anybody explain to me what a sprite is and how do you use/create them THX. :banghead:
-
Sprite is an 8x8 object used in games
A sprite would be stored like
[sprite data]->Pic1
Or pic2, pic3 etc
Inside the [], the sprite is in hexadecimal.
For example,
[FFFFFFFFFFFFFFFF]->Pic1
(16 Fs) would make a block that is all black
To make the hexadecimals, I use the program included in the axe folder that is with the app
It is called HEXPIC , I believe.
To use them, once you have stored it, like in pic1
Do
Pt-On(X coord, Y coord,Pic1)
(and don't forget to DispGraph ;) )
-
THX
-
And if you are making the sprite move, I suggest using
Pt-change(X,Y,pic#)
dispgraph
Pt-change(X,Y,pic#)
pt change simply changes the point from on to off, or vis versa. And pt-on just turns it on, or pt-off which is off. :)
-
Lol, I've never used that before :P
I just do pt-On
and always have a dispgraphclrdraw
I tried pt-off once but it screwed up ???
-
Lol, I've never used that before :P
I just do pt-On
and always have a dispgraphclrdraw
I tried pt-off once but it screwed up ???
yeah me too, I save everything but the moving thing to the back buffer and use RecallPic every Frame.
-
point off just makes the 8 by 8 white, then draws the black part to the screen :P
-
Lol, I've never used that before :P
I just do pt-On
and always have a dispgraphclrdraw
I tried pt-off once but it screwed up ???
yeah me too, I save everything but the moving thing to the back buffer and use RecallPic every Frame.
Ooh, good idea.
Wait, how? :P
-
Lol, I've never used that before :P
I just do pt-On
and always have a dispgraphclrdraw
I tried pt-off once but it screwed up ???
yeah me too, I save everything but the moving thing to the back buffer and use RecallPic every Frame.
Ooh, good idea.
Wait, how? :P
I usually use an appvar- do this:
:GetCalc("appvLELVEL",Y0
:Copy(Y0,L3,768
:Repeat GetKey(15)
:RecallPic
:draw player and stuff
:DispgraphClrdraw
:movement stuff
:End
-
Wait, how do you make appvars?
-
Wait, how do you make appvars?
:GetCalc("appvNameOfAppvar",#OfBytes)->Pointer
then to store stuff into it:
Copy(StuffToCopy,Pointer,#OfBytes)
...such as:
:GetCalc("appvBLAH",768)->A //apvar created and stored into A with 768 bytes (enough for a picture)
:Copy(L6,A,768) //copies buffer into appvar (just like an OS pic)
-
so is L6 a list? How does that part work, How do I put stuff as the list?
-
so is L6 a list? How does that part work, How do I put stuff as the list?
L6 isn't a "list", such as the lists in the OS, but they are Pointers.
L6 happens to be where the data for the buffer is stored. (buffer: aka: graph screen ;))
when you use the command dispgraph, it evaluates the data in L6 and draws points accordingly.
-
so could I store a main loop as an appvar? for example, could I have my program set up as this:
in the program it has the menu info, then if you press level 1 it opens appvLEVEL1 which has all of the loop and stuff for that level, ? This is, to store level 1 as an appvar instead of another program.
-
so could I store a main loop as an appvar? for example, could I have my program set up as this:
in the program it has the menu info, then if you press level 1 it opens appvLEVEL1 which has all of the loop and stuff for that level, ? This is, to store level 1 as an appvar instead of another program.
you can store data in an appvar, but as far as putting code in them, it doesn't work. I'm not sure why, but asm people say that a lot of stuff gets screwed up. (ask asm person for more info)
-
oh ok then :) thanks
-
*sniff* I'm so proud of you, parser, my star pupil. (my only pupil. and not really actually my pupil).
...methinks you may have used that appvar technique from my GPOS thread? ;) (it's totally fine, I'm just curious)
-
quick question is storing something in appvars really the same as storing something in pic 1,pic2 etc., and if not what are the differences
-
Assuming you're talking about the OS's Pic0-Pic9 and not an Axe pointer name, yes they are the same from a coding perspective. To the OS, they are a little different though. When the OS sees a Pic1 it assumes its a picture and will let you use all those BASIC commands on it. When you use an appvar, the OS will not really let you do much to them and the only place you will see them is in the memory management screen. Also, appvars will take up more room in RAM since they also have names which are up to 8 characters long.
But yeah, other than that, you can store data to anything and use it just the same: appvars, pics, strings, lists, even the OS vars. But the best option for regular data is probably the appvar because its invisible to the end user and can't be deleted accidentally unlike a pic or string for instance which will get overridden constantly by BASIC programs.
-
*sniff* I'm so proud of you, parser, my star pupil. (my only pupil. and not really actually my pupil).
lol
...methinks you may have used that appvar technique from my GPOS thread? ;) (it's totally fine, I'm just curious)
? can i have a link?
-
GPOS stands for Game Programming On Steroids, I'm assuming you didn't then ;)
-
I know that L6 is the main buffer (plotSScreen in asm), but i assume that it isnt the pointer to the graph screen data. How can i have an axe program (like graphjump or wormy in grammer) that can use the data from the graph screen?
-
What do you mean by graph screen? L6 is indeed the pointer to the main buffer, where the graphscreen images are stored.
-
like if from the homescreen you do a RecallPic or even just draw on the graph screen, when an axe program is run, it can use that data even without it being saved to a picture. Is this possible?
-
If the data is already on the graphscreen when the Axe program is run, the data will be stored in L6.
-
alright, ill try it.
Edit: it works, thanks!
In case youre wondering, im making a game similar to grammer's graphjump with axe. It is more advanced, however, with 8-directional shooting that will destroy walls and more easily controllable left/right/jumping. ill release a demo soon. atm, the player (a pixel) starts at (1,1), jumps 5 pixels up, and can shoot one bullet at a time (it has to hit something in order for you to shoot again). controls are:
left=left
right=right
up=jump
numpad shoots:
7 8 9
4 * 6
1 2 3
Still have to work out some bugs though, like if you hold down up and shoot straight down, you jump off of the bullet :P