Join us on Discord!
You can help CodeWalrus stay online by donating here.

Metal Slug: Assault

Started by matrefeytontias, March 14, 2015, 11:52:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Duke "Tape" Eiyeron

I meant multiple platforms on the same x position? Like floating blocks or things like that!
  • Calculators owned: A lot.

matrefeytontias

Remember that what I just did is a "ground" engine. I will only use it to handle ground, ie something you can't be under (I actually made it handle vertical walls as well). I'll have normal tilemap collisions running on top of that (obviously platforms will have to remain horizontal), that's why I wanted that one to be as lightweight and fast as possible (and trust me it is. If you look at the screenshot closely you'll notice the character is only moving left and right one pixel at a time).
  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Duke "Tape" Eiyeron

Yeah, it's smooth and fast enough. With that kind of engine, slopes will be quite epic to climb up and down!
  • Calculators owned: A lot.

CKH4

Will we get to see the source at some point? I'd like to study it because that looks impressive.
  • Calculators owned: TI-83+, TI-84+


Snektron

YEah maybe it's a good idea to release it so others ay use this awesome engine :)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Oh those are hitboxes? Nifty matref !  :thumbsup:
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

matrefeytontias

Alright here's the source code (SourceCoder-compatible), and attached is the 8xp form of the source code. If you have any question, please ask.

[spoiler]
.LINEMAP

Fix 5

DiagnosticOff

[F8F8F8F8F8000000->Pic1

2->^^oCenter
3->^^oHeight

10->^^oBPL

Data(6)
Data(0^^r,10^^r,0^^r,60^^r,0,1)->GDB1MAP
Data(0^^r,10^^r,95^^r,32^^r,48,11)
Data(96^^r,32^^r,151^^r,0^^r,27,~16)
Data(152^^r,0^^r,152^^r,15^^r,0,1)
Data(152^^r,16^^r,200^^r,16^^r,1,0)
Data(200^^r,16^^r,200^^r,60^^r,0,1)

|E8000->^^oCamX+2->^^oCamY+2->^^oDX+2->^^oDY+2->^^oUDX+2->^^oUDY+2->^^oTX+2->^^oTY+2->^^oT1+2->^^oT2+2->^^oCanJump

32->^^oDec
6->^^oFriction
~4->^^oGrav
^^oDec->^^oMaxDX
12->^^oAX

0->CamX->CamY->DX->DY->CanJump

32*^^oDec->X

60*^^oDec->Y

While 1
.Display ground
For(T1,0,{GDB1MAP-1}-1)
T1*^^oBPL+GDB1MAP->T2
CLine({T2}^^r-CamX,63-{T2+2}^^r+CamY,{T2+4}^^r-CamX,63-{T2+6}^^r+CamY)
End

.X collision
X->TX+DX->X
TX//^^oDec->[r3]
X//^^oDec->[r4]
Y//^^oDec-^^oHeight->[r5]
~1->[r1]
While 1
[r1]++*^^oBPL+GDB1MAP->[r2]
If {[r2]}^^r={[r2]+4}^^r
If [r5]-{[r2]+6}^^r/32768
If [r4]-{[r2]}^^r=0 or ([r3]-{[r2]}^^r/32768+([r4]-{[r2]}^^r/32768)=1)
-1->DX
{[r2]}^^r-([r3]-{[r2]}^^r/32768*2-1)*^^oDec->X
1
End
End
End
EndIf  or ([r1]+1={GDB1MAP-1})

.Find what line the player is on
~1->[r1]
X/^^oDec->TX
While 1
[r1]++*^^oBPL+GDB1MAP->[r6]
EndIf [r1]+1={GDB1MAP-1} or (TX>={[r6]}^^r and (TX<={[r6]+4}^^r))

.Y collision
Y+DY->Y
sign{[r6]+9}->[r1]
~sign{[r6]+8}->[r2]
~({[r6]}^^r-CamX*[r1])-({[r6]+2}^^r-CamY*[r2])->[r3]
X/^^oDec-CamX->TX
Y/^^oDec-CamY-^^oHeight->TY
.Must be <=0
!If TX*[r1]+(TY*[r2])+[r3]-1/32768
->DY+1->CanJump
~(TX*[r1]+[r3])//[r2]+CamY+^^oHeight*^^oDec->Y
Else
-1->CanJump
End

.Player input
If abs(DX)<^^oMaxDX
getKey(3)-getKey(2)*^^oAX+DX->DX
End
If getKey(54) and CanJump
-1->CanJump
^^oDec*2->DY
End

If DX>>0
DX-min(^^oFriction,DX)
ElseIf DX<<0
DX+min(^^oFriction,~DX)
End
->DX

DY+^^oGrav->DY

X/^^oDec-48->[r1]/32768?-1,[r1]
->CamX
Y/^^oDec-32->[r1]/32768?-1,[r1]
->CamY

Pt-On(X/^^oDec-CamX-^^oCenter,63-(Y/^^oDec-CamY+^^oCenter),Pic1)
DispGraphClrDraw
EndIf getKey(15)
Fix 4
Return

Lbl CLine
[r1]->Z
[r2]->theta
sub(Region)->D
[r3]->Z
[r4]->theta
sub(Region)->E
0->A->B

While 1
!If D or E
+1->A->B
ElseIf D and E
1->B
Else
D?,E
->F
If  and 1
[r3]-[r1]*(64-[r2])//([r4]-[r2])+[r1]->[r5]
63->[r6]
ElseIf F and 2
[r3]-[r1]*~[r2]//([r4]-[r2])+[r1]->[r5]
0->[r6]
ElseIf F and 4
[r4]-[r2]*(96-[r1])//([r3]-[r1])+[r2]->[r6]
95->[r5]
Else
[r4]-[r2]*~[r1]//([r3]-[r1])+[r2]->[r6]
0->[r5]
End
!If F-D
[r5]->[r1]->Z
[r6]->[r2]->theta
sub(Region)->D
Else
[r5]->[r3]->Z
[r6]->[r4]->theta
sub(Region)->E
End
End
EndIf B
Return!If A
Line([r1],[r2],[r3],[r4]
Return

Lbl Region
0->C
If theta>>63
C or 1->C
ElseIf theta<<0
C or 2->C
End
If Z>>95
C or 4->C
ElseIf Z<<0
C or 8->C
End
C
[/spoiler]

Annoying : code boxes are actually not boxes, just plain formatting. It's annoying when posting long code like that.
  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Snektron

  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Awesome. Also thanks for reminding me to fix CODE tags. I did that to see if it would let me circumvent the small code in chrome glitch in SMF, to no avail, but I forgot to revert my changes.

I'm gonna download your program when I arrive home.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

matrefeytontias

Alright so I decided to recode it entirely in ASM while there's not much done. So far I've got gravity and movement working and a decent display system. Next I'm going to add the hitlines thing. Also, a friend of mine decided to help me by taking care of all graphics and level design. That should be very helpful :D

  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Unicorn

  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

Ooh glad this is being worked on again. I was a little worried it might have been forgotten or something due to you being too busy with school. I wish you good luck implementing everything and hopefully your friend can help you with the graphics (and not disappear halfway through like it is the case with many projects :P)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

Wooo I'm working on this AMazing project right now and...

Ya know what, lets just disapear so this proj never finishes.

Does that happen for reals? :|
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Snektron

More often than you think ;D i have about 10 projects i started but never finished
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


CKH4

Yes it does, usually I make sure that I'm going to finish the project before I make a topic about it. Anyways I think that part of the reason matref decided to share was that I asked him about it on irc. Usually you can get an author to work on their project more by giving them an occasional poke (its bad if you poke more than once a week because they may feel like they are being bugged).

Also matref was there any benefit of moving to asm besides learning to write a game in asm?
Edit. Also I love the gravity, I can never get mine to work when I try platformers.
  • Calculators owned: TI-83+, TI-84+


Powered by EzPortal