Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: BrownyTCat on April 18, 2011, 02:36:24 pm

Title: Trying to build some kind of a platformer thing, help? (AXE)
Post by: BrownyTCat on April 18, 2011, 02:36:24 pm
 :(
It doesn't seem to be working, I had a pure BASIC ASCII platform engine a while ago, but I need a simple engine for making arrays to store the levels, which are approximately... 12x8 tiles that are 8x8 pixels.

I barely started but need:
♦Level arrays that can be read for collisions and drawing the level (of course)
♦Better gravity/velocity engine, support 'jumping'.
(SOLVED)♦How to store over 10 sprites? [Hex]->Pic1 twice even with new hex produces an ERR:DUPLICATE.

I have these under control:
♦ Sprites
♦ Concept/Gameplay


Here is the sauce source so far:

Code: [Select]
.TESTPROG A test program
ClrHome
.CHARACTER
[3C243C3C7EBD2442]->Pic1
.BLOCK
[FFD5ABD5ABD5ABFF]->Pic2

0->K
0->X
0->Y
0->V                                                          //Was going to hold velocity or something, left it in.

ClrDraw

While K =/= 1                                       //Using "Down" as a placeholder
ClrDraw
Pt-On(0,48,Pic2)
Pt-On(8,48,Pic2)
Pt-On(16,48,Pic2)
Pt-On(X,Y,Pic1)
DispGraph
getKey->K
If pxl-Test(X,Y+8)=0
Y+1->Y
End
If K=3
X+4->X
End
If K=2
X-4->X
End
If K=4                                       //This is going to be 2ND.
If pxl-Test(X,Y+8)=1
Y-16->Y                                       //Utterly crappy excuse for a jump
End
End
End
Title: Re: Trying to build some kind of a platformer thing, help?
Post by: Stefan Bauwens on April 18, 2011, 02:57:59 pm
I am not really good at this, and I don't program for the z80 calcs, but can't you just use a matrix to store your levels?
For example in your matrix 1 stands for sprite1, 2 for sprite2, etc...
And with a while in your program you could load the level.
Title: Re: Trying to build some kind of a platformer thing, help?
Post by: Munchor on April 18, 2011, 03:33:12 pm
:(
It doesn't seem to be working, I had a pure BASIC ASCII platform engine a while ago, but I need a simple engine for making arrays to store the levels, which are approximately... 12x8 tiles that are 8x8 pixels.

I barely started but need:
♦Level arrays that can be read for collisions and drawing the level (of course)
♦Better gravity/velocity engine, support 'jumping'.
♦How to store over 10 sprites? [Hex]->Pic1 twice even with new hex produces an ERR:DUPLICATE.

I have these under control:
♦ Sprites
♦ Concept/Gameplay


Here is the sauce source so far:

Code: [Select]
.TESTPROG A test program
ClrHome
.CHARACTER
[3C243C3C7EBD2442]->Pic1
.BLOCK
[FFD5ABD5ABD5ABFF]->Pic2

0->K
0->X
0->Y
0->V                                                          //Was going to hold velocity or something, left it in.

ClrDraw

While K =/= 1                                       //Using "Down" as a placeholder
ClrDraw
Pt-On(0,48,Pic2)
Pt-On(8,48,Pic2)
Pt-On(16,48,Pic2)
Pt-On(X,Y,Pic1)
DispGraph
getKey->K
If pxl-Test(X,Y+8)=0
Y+1->Y
End
If K=3
X+4->X
End
If K=2
X-4->X
End
If K=4                                       //This is going to be 2ND.
If pxl-Test(X,Y+8)=1
Y-16->Y                                       //Utterly crappy excuse for a jump
End
End
End

Use Pic1+, Pic1- there are over 256 sprite images, you can symbols after Pic
Title: Re: Trying to build some kind of a platformer thing, help?
Post by: ZippyDee on April 18, 2011, 03:34:58 pm
You can't use [HEX]->Pic1 multiple times. Storing data to Pic1 creates a pointer to that data. The pointer remains constant. You have to use Copy( to copy sprite data to the data at that pointer in order to use it.
Title: Re: Trying to build some kind of a platformer thing, help? (AXE)
Post by: BrownyTCat on April 19, 2011, 10:31:45 am
I'm currently just working on gravity, I have this in my initialization:
Code: [Select]
V=50
And this is in the main loop:
Code: [Select]
If
pxl-Test(X,Y+8)=0
V-1->V
If V>1
Pause V
End
Y+1->Y
Else
50->V
End
Basically, this is a gravity handler, and it's fine for the most part, I just need the "jumping" thing. Maybe use a variable in place of 1, ie:
Code: [Select]
Y+G->YPossibly keep the pause and add more dramatic gravity, like in each falling loop until you hit ground, you get +1 to G until you reach Terminal Veocity.
???
Title: Re: Trying to build some kind of a platformer thing, help? (AXE)
Post by: Fast Crash on April 19, 2011, 11:47:17 am
This helped me a lot :
http://ourl.ca/4279
Title: Re: Trying to build some kind of a platformer thing, help? (AXE)
Post by: BrownyTCat on April 26, 2011, 11:20:36 am
It helped me a little, and also made my head burst into flames.