Author Topic: Trying to build some kind of a platformer thing, help? (AXE)  (Read 5352 times)

0 Members and 1 Guest are viewing this topic.

Offline BrownyTCat

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 420
  • Rating: +37/-8
    • View Profile
Trying to build some kind of a platformer thing, help? (AXE)
« 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
« Last Edit: April 19, 2011, 10:35:30 am by BrownyTCat »

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Trying to build some kind of a platformer thing, help?
« Reply #1 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.


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Trying to build some kind of a platformer thing, help?
« Reply #2 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

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: Trying to build some kind of a platformer thing, help?
« Reply #3 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.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline BrownyTCat

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 420
  • Rating: +37/-8
    • View Profile
Re: Trying to build some kind of a platformer thing, help? (AXE)
« Reply #4 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.
???

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Trying to build some kind of a platformer thing, help? (AXE)
« Reply #5 on: April 19, 2011, 11:47:17 am »
This helped me a lot :
http://ourl.ca/4279

Offline BrownyTCat

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 420
  • Rating: +37/-8
    • View Profile
Re: Trying to build some kind of a platformer thing, help? (AXE)
« Reply #6 on: April 26, 2011, 11:20:36 am »
It helped me a little, and also made my head burst into flames.