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.


Topics - animaaron

Pages: [1]
1
Axe / Jumping code?
« on: February 19, 2016, 02:10:48 pm »
I'm trying to make a platformer - and for the most basic platformer ever, you need jumping. I tried to implement somewhat logical physics, no matter how simple, but I obviously did something wrong. Despite seemingly making it so that the character goes up 7 pixels (4 + 2 + 1 + 0) and then down 7 blocks (0 - 1 - 2 - 4), they just fall straight down, off the screen. Here's my jumping code:
Code: [Select]
Lbl JMP
Y+A>A

If A^2=0
A/2>A
End
If A=1 or A=0 or A=-1
A--
End
If A=-2
A-2>A
End
If A=-4
4>A
End

And this is how it's called:

Code: [Select]
Repeat getKey(15)

//blah blah game loop

If getKey(54) or (A!=4)
sub(JMP)
End

//blah blah blah

End //game loop ends

And yeah, that's not optimized at all. Hahaha

2
Axe / HELP- Problems with Collision Detection
« on: April 25, 2015, 05:47:04 pm »
I'm having trouble with the collision detecting in a simple map I made using a tut I found on the forum.. I don't know whats wrong, cant find a problem anywhere. :w00t:

Here's the code, if you can help me.

Code: [Select]
.TILENOSC
[AA4400552200AA44]->Pic0
[FFFFFFFFFFFFFFFFFF]

[020202020202010202020202]->GBD1
[020000000000000000000002]
[020000000000000000000002]
[020000000000000000000002]
[020000000000000000000002]
[020000000000000000000002]
[020000000000000000000002]
[020202020202010202020202]

48->X
40->Y

Repeat getKey(56)
For(B,0,7
For(A,0,11
{B*12+A+GBD1}->T
If T
T--
Pt-On(A*8,B*8,T*8+Pic0
End
End
End
Pt-On(X,Y,[7E81FFA57E5A7E42])
DispGraph
ClrDraw

If getKey(4)
!If sub(GT,X,Y-8)=2
Y-8->Y
Pause 500
End
End

If getKey(1)
!If sub(GT,X,Y+8)=2
Y+8->Y
Pause 500
End
End

If getKey(2)
!If sub(GT,X-8,Y)=2
X-8->X
Pause 500
End
End

If getKey(3)
!If sub(GT,X+8,Y)=2
X+8->X
Pause 500
End
End

End
Return

Lbl GT
{r[sub]2[/sub]/8+12+(r[sub]1[/sub]/8)+GBD1}
Return

There it is. Please, if you find something wrong, tell me so I can make this work

Pages: [1]