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.


Messages - animaaron

Pages: [1]
1
Axe / Re: Jumping code?
« on: February 21, 2016, 02:46:14 pm »
Yes, I knew that '^' is a modulo, if A is even I want to halve it, and if it's not I want to do other things. I changed
Code: [Select]
If A=1 or (A=0) or (A=-1)to this:
Code: [Select]
If abs(A)<2  //checks if A is less than 2 (if it's 2 it should be divided by 2)
Also, I changed all of the 'If' s after my first If to ElseIfs so that only one of them evaluates to true. Now when I hit the 2nd key, my sprite doesn't fall off the screen, but it goes down 7 pixels and then doesn't move anymore, even if I hit 2nd again.

EDIT: I changed the first "If" to this:
Code: [Select]
If A^2=0 and (A>0)
and now when I hit 2nd my character goes down 7 pixels and then up infinitely. I also forgot that (0,0) is in the UPPER left hand corner, so a positive value of A would make them go down. So I need the starting value of A to be negative for them to go up and then back down

2
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

3
Axe / Re: Axe Q&A
« on: April 30, 2015, 05:41:21 pm »
I don't understand what the r1 pointers (found under the vars>polar menu) are used for

4
Axe / Re: HELP- Problems with Collision Detection
« on: April 26, 2015, 07:49:03 pm »
I'm still having problems...
Code: [Select]
prgmASSETS   //loads all my sprites
prgmGDB        //loads my GDBs (rn theres only 2)

GDB1->G

48->X
40->Y
32->S             //S and T are the variables that mark where you
32->T             //need to go for the next GDB

Repeat getKey(56)
...                   //Stuff to load the GDB
If getKey(4) and (sub(GT,X,Y-8)=0 or (sub(GT,X,Y-8)=7))
Y-8->Y
Pause 500
sub(LOC)
End

...                    //The rest of the keys

End
Return
prgmSUB          //Has all my routines
That's my main program, and there might already be problems, idk. Here's my routine prgm

Code: [Select]
Lbl GT
{r[sub]2[/sub]/8*12+(r[sub]1[/sub]/8)+G}
Return

Lbl LOC
If X=S and Y=T
If G=GBD1
GBD2->G
80->S                  //These are just temporary numbers. I might change them later. I don't really
48->T                  //think it matters though
Pause 2000
End
Return
End

That's it... tell me what you find out

5
Axe / Re: HELP- Problems with Collision Detection
« on: April 26, 2015, 02:31:10 pm »
How would I make it so I can switch between GDBs when my character is at a certain spot, to enter a new area?

6
Axe / Re: thydowulays's Complete n00bs guide to Tilemapping in Axe
« on: April 26, 2015, 08:39:03 am »
@Sorunome I have more than one tile I want to test for, so instead of writing !If ... I wrote
Code: [Select]
If getKey(1) and (sub(GT,X,Y+8)=0 or sub(GT,X,Y+8)=3)
Y+8->Y
Pause 500
End
And so on for the rest of the arrow keys

When I write this, my sprite doesn't move at all

7
Axe / Re: HELP- Problems with Collision Detection
« on: April 25, 2015, 07:46:54 pm »
@ben_g THANK YOU SO MUCH!!! Ugh stupid little mistakes... its always just one little stupid mistake..

8
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

9
Axe / Re: thydowulays's Complete n00bs guide to Tilemapping in Axe
« on: April 25, 2015, 05:20:18 pm »
The collision detection isn't working properly for me!!! :(

Pages: [1]