Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Deep Toaster on February 20, 2011, 01:40:14 pm

Title: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 20, 2011, 01:40:14 pm
This is going to be a monster tutorial that'll take a while for me to write, so here are the first five parts:

Arrays and Bullet Code (http://clrhome.org/tutorials/arrays/)

Axe doesn't natively support any data structures, but that doesn't mean you can't use any in your Axe programs. Because Axe allows you to manipulate the bytes and bits of your calculator all you want, you can make your structures, made in whatever way best suits you. Axe is a versatile tool.

One of the most useful data structures (by far) is the array. An array is just a list of data elements, which could be anything—bullets, enemies, lobsters, etc. In fact, if you think about it, a tilemap is a type of array (a two-dimensional one).

So how do you make an array in Axe? Well, first you need to decide where to put it. Any safe RAM area (L1, L2, etc.) will do. Just make sure it's reasonably big enough. Arrays can take a lot of memory.

Now decide how each element is going to be stored. What are you representing with each element? Just for the sake of example, let's say you're making a program to keep track of some squares floating around the screen but always going in one direction. You'd need to keep track of its X and Y values, as well as how fast it's moving horizontally and vertically. That would be four bytes per element. (You could probably cut it down to three or even two if you desparately neede to, but I'll keep things simple.) The array could look like this:

(http://img.removedfromgame.com/imgs/table.jpg)

Like with everything in Axe, we start counting from 0 because it makes our lives much, much easier.

To start working on our example, make a program called ASQUARE as follows:

(http://clrhome.org/homer/PROGRAM%3AASQUARES%3A.SQUARES%0D%0A%3AprgmASQUI%0D%0A%3ARepeat+getKey%2815%29%0D%0A%3Asub%28DA%29%0D%0A%3ADispGraph%0D%0A%3Asub%28DA%29.png)

(http://clrhome.org/homer/%3AEnd%0D%0A%3AReturn%0D%0A%3AprgmASQUR.png)

This will be our main program. It should be pretty simple to understand: it first initializes some data (the code for which we're going ot put in a subprogram called ASQUI), then goes in a loop where it draws the squares until you quit. prgmASQUR will hold our subroutines.

For program ASQUI, just put this in:

(http://clrhome.org/homer/PROGRAM%3AASQUI%0D%0A%3A..INIT%0D%0A%3A%C3%81FFFFFFFFFFFFFFFF%5D%1CPic0%0D%0A%3A0%1CL.png)

That's it. L will hold the current size (length, number of elements) of the array. It'll get updated whenever we modify the array (in the subroutine itself).

Displaying objects in the array (http://clrhome.org/tutorials/arrays/01/)

An array of data (or any other data structure) is pretty much useless unless you do something with it. Here we'll make the subroutine DA that displays all the elements in the array.

First, make a new program called ASQUR and put this inside. All our routines will go in it.

(http://clrhome.org/homer/PROGRAM%3AASQUR%0D%0A%3A..ROUTINES.png)

Quote from: Draw all elements
Variables:
    The only global variable you really need will be one giving you the size (length) of the array (L).
    
    L - current length of array (initialized to 0 at the beginning of the program and updated by the routine itself)

Input:
    None.

Output:
    None. It draws the sprites to the buffer, but that's pretty much it.

Code:
(http://clrhome.org/homer/%3ALbl+DA%0D%0A%3AIf+L%0D%0A%3AFor%28I%2C1%2CL%29%0D%0A%3APt-Change%28{I*4%2BL%81-4%1CJ}%2C{J%2B1}%2CPic0%29%0D%0A%3AEnd%0D%0A%3AReturn.png)

You probably don't need too much explaining, so I'll keep it short. First, there's "If L." This is to avoid an (almost) infinite loop when L happens to be zero. (We loop from 1 to L and subtract four more instead of from L-1 to L-1 because it's a lot faster to check each pass of the loop.) Then the routine loops through every element, using Pt-Change( to display each one.

We use Pt-Change( here because it's the easiest to work with when you want to draw a moving object. It works like this: Just before the main program calls DispGraph, we draw all the squares onto the screen so they appear, and once the screen finishes displaying, all the squares get removed with the same routine to make it "clean" again. This makes things easier if you're making a complex tilemap game where redrawing the entire screen every frame takes too much time.

Anyway, now that you've defined the subroutine, you can compile your program now! And run it! what does it do?

Nothing. It waits until you press CLEAR. That's because you haven't added any elements to the array yet. We'll get there in the next step.

Manipulating the array (http://clrhome.org/tutorials/arrays/02/)

Now a routine to add (push) an element to the end of the array. Put this in program ASQUR.

Quote from: Pushing an element
Variables:
    The only global variable you really need will be one giving you the size (length) of the array. Let's call it L.
    
    L - current length of array (initialized to 0 at the beginning of the program and updated by the routine itself)

Input:
    Since each element holds four values, let's make each one an argument.
    
    r1 - X-value of new square
    r2 - Y-value of new square
    r3 - X-speed of new square
    r4 - Y-speed of new square

Output:
    None. (Of course, you could easily modify it to return a useful value, such as a pointer to the element added.)

Code:
(http://clrhome.org/homer/%3ALbl+PE%0D%0A%3AIf+L%3C177%0D%0A%3Ar%84%1C{r%83%1C{r%82%1C{r%81%1C{L%2B1%1CL*4%2BL%81-4}%2B1}%2B1}%2B1}%0D%0A%3AEnd%0D%0A%3AReturn.png)

Scary? Fine, I'll break it down.

Before it does anything, it checks if there are 177 elements in the list. This is because L1 can only hold 714 bytes of data, which is approximately 178*4 elements. If you're using any safe RAM location, make sure you change this limit accordingly. Having too many elements is called an overflow, which could mess up whatever data comes after L1 (in this case the variables A through T.

First look at the very inside of the mess of braces, at the line "L+1?L*4+L1-4." The real action starts there. First, it increments L by one (you probably know why). Since that command returns the value of L, you can keep doing operations on it (multiplying by four in this case). Since each element in our example is four bytes long, L*4 gets the offset of the next element in the array. But there's a problem here: Since you incremented L already, this now points four bytes ahead of where you're supposed to be. We take care of this by adding only L1-4 to the total.

That gives us a pointer to where to store the first byte of the element, so "r1?{L+1?L*4+L1-4}" would store the first byte there.

Now here's the fun part: By storing to a variable location, the pointer you stored to is returned in HL. That means that you can keep on storing to the byte after it by simply adding one! That's why the line above is enclosed by "r2?{ ... +1}": you just add one to get the next byte, then store to it. You can keep going like this for as long as you want; it's the single most optimized way to store a mass of variable data in Axe!

Next up we'll actually add the pretty squares. Promise.

Actually doing something (http://clrhome.org/tutorials/arrays/03/)

Finally we're going to add the actual enemies (squares). Here are some ideas for how they should be added:


To do this, we need to back to the main program, into the main loop (Repeat getKey(15):End). Change prgmASQUARES into this:

(http://clrhome.org/homer/PROGRAM%3AASQUARES%3A.SQUARES%0D%0A%3AprgmASQUI%0D%0A%3ARepeat+getKey%2815%29%0D%0A%3AIf+rand%3C4096%0D%0A%3Asub%28PE%2C44%2C28%2Crand^3%2Crand^3%29.png)

(http://clrhome.org/homer/%3AEnd%0D%0A%3Asub%28DA%29%0D%0A%3ADispGraph%0D%0A%3Asub%28DA%29%0D%0A%3AEnd%0D%0A%3AReturn%0D%0A%3AprgmASQUR.png)

All the changes come just before the first sub(DA).

You probably understand this too. If a random two-byte integer is less than 4096 (that's a chance of 4096/65536, or 1/16), stick a square in the middle of the screen and give it a random X- and Y-speed. Then quit when the user presses CLEAR.

Before we compile, there's one thing that's missing. Something that every enemy/bullet system needs to have—movement. So change prgmASQUARES again:

(http://clrhome.org/homer/PROGRAM%3AASQUARES%3A.SQUARES%0D%0A%3AprgmASQUI%0D%0A%3ARepeat+getKey%2815%29%0D%0A%3AIf+rand%3C4096%0D%0A%3Asub%28PE%2C44%2C28%2Crand^3%2Crand^3%29.png)

(http://clrhome.org/homer/%3AEnd%0D%0A%3AIf+L%0D%0A%3AFor%28I%2C1%2CL%29%0D%0A%3A{I*4%2BL%81-4%1CJ}%2B{J%2B2}%1C{J}%0D%0A%3A{J%2B1}%2B{J%2B3}%1C{J%2B1}%0D%0A%3AEnd.png)

(http://clrhome.org/homer/%3AEnd%0D%0A%3Asub%28DA%29%0D%0A%3ADispGraph%0D%0A%3Asub%28DA%29%0D%0A%3AEnd%0D%0A%3AReturn%0D%0A%3AprgmASQUR.png)

All the new additions are right after the ones you just added. The point here is that it has to be before the first sub(DA). Otherwise, you'd be changing the squares' position after they get drawn but before they get erased, so they'd end up being "erased" from a different location.

Well? Compile and run!

(http://clrhome.org/tutorials/arrays/squares.gif)

It works! Amazing, eh? You can let it run for as long as you want, and even though it slows down quite a bit with a lot of enemies on the screen, they all move on their own!

The only problem now is that they keep wrapping around the screen. Usually that's not what you want to happen, since if an enemy or bullet goes off the screen, it should stay off the screen. We'll take care of that in the next section.

Getting rid of the extras (http://clrhome.org/tutorials/arrays/04/)

To make the squares more realistic enemies, we're going to remove them when they go off the screen. That calls for a new routine:

Quote from: Removing an element
Variables:
    And yet again, you need L.
    
    L - current length of array (initialized to 0 at the beginning of the program and updated by the routine itself)

Input:
    Well, we need to know which element ot remove.
    
    r1 - Index of element to remove

Output:
    None. (Again, you can modify it to return something useful, but we won't here.)

Code:
(http://clrhome.org/homer/%3ALbl+RE%0D%0A%3ACopy%28r%81*4%2BL%81%2B4%2C-4%2CL-1%1CL-r%81*4%2B1%29%0D%0A%3AReturn.png)

You can probably tell that it's a copy statement. What we're trying to do is copy everything after the element to be removed four bytes back—overwriting the element you want to remove. The routine also takes care of the array length variable (L) by subtracting one.

The only thing that should seem weird here is the extra "+1" at the end. It might not make sense, but it takes care of the case where you're trying to remove the very last element. If that extra little bit of code weren't there, the Copy( statement would try to copy 0 bytes backwards, which gets translated to a copy a 65536 bytes, which is definitely not what you want. This extra bit doesn't do us any harm besides slowing the program down a tiny, tiny bit, but it takes care of that scenario for us.

So now that you have the routine down, let's actually use it. Go back into the main program and change it to this:

(http://clrhome.org/homer/PROGRAM%3AASQUARES%3A.SQUARES%0D%0A%3AprgmASQUI%0D%0A%3ARepeat+getKey%2815%29%0D%0A%3AIf+rand%3C4096%0D%0A%3Asub%28PE%2C44%2C28%2Crand^3%2Crand^3%29.png)

(http://clrhome.org/homer/%3AEnd%0D%0A%3AIf+L%0D%0A%3AFor%28I%2C1%2CL%29%0D%0A%3AIf+{{I*4%2BL%81-4%1CJ}%2B{J%2B2}%1C{J}}%1996%0D%0A%3AGoto+RM%0D%0A%3AEnd%0D%0A%3AIf+{{J%2B1}%2B{J%2B3}.png)

(http://clrhome.org/homer/%1C{J%2B1}}%1964%0D%0A%3ALbl+RM%0D%0A%3Asub%28RE%2CI-1%1CI%29%0D%0A%3AEnd%0D%0A%3AEnd%0D%0A%3AEnd%0D%0A%3Asub%28DA%29%0D%0A%3ADispGraph.png)

(http://clrhome.org/homer/%3Asub%28DA%29%0D%0A%3AEnd%0D%0A%3AReturn%0D%0A%3AprgmASQUR.png)

All the changes are in the For(I,1,L) loop. It basically tests the X- and Y-values after they're changed to see if they're completely off the screen, and if so, they get removed. The reason I jump to a lable RM instead of writing the code twice is because it's smaller and even gets rid of any chance of some certain nasty coincidences I won't talk about here. The point is it works.

(http://clrhome.org/tutorials/arrays/squares1.gif)

Arrays in arrays (in arrays) (http://clrhome.org/tutorials/arrays/05/)

So there you are. Arrays in Axe.

Before we leave you to coding in peace, there's one last trick we're here to teach you: how to make arrays whose elements are arrays in their own right, or arrays of arrays.

Arrays in arrays? What's the point of that?

Surprisingly, you can do a lot with them. For example, say you have a puzzle game where each level has a fixed set of enemies. Instead of making a gigantic if-elseif-elseif-elseif... structure, you can put the enemy data for each level in an array, then organize that whole thing into an array.

But here's the problem: How do you store an array of elements that aren't a fixed size? The real problem comes in parsing it—how could you loop through a list whose elements could be any number of bytes long?

Like with any varying array, the solution comes in embracing the pointers. By that we mean simply that you don't have to put the structures themselves into the array; just point to them. Here's an example.

First, create the raw data you're going to put into an array.

(http://clrhome.org/homer/PROGRAM%3AA%0D%0A%3A.B%0D%0A%3A%22The+G%22%1CStr000%0D%0A%3A%22ame+i%22%1CStr001%0D%0A%3A%22s+nea%22%1CStr002%0D%0A%3A%22r.+Pr%22%1CStr010%0D%0A%3A%22epare%22%1CStr011.png)

Here are the first-level arrays:

(http://clrhome.org/homer/%3AData%283%2CStr000%15%2CStr001%15%2CStr002%15%29%1CStr00%0D%0A%3AData%282%2CStr010%15%2CStr011%15%29%1CStr00.png)

Notice we use Data( with each pointer followed by an r (since pointers are always two bytes). The 3 and 2 in the beginning denote the number of elements in that array, since this value can change. Now it's the arrays' turn to be referenced from an array, in much the same way:

(http://clrhome.org/homer/%3AData%28Str00%2B1%15%2CStr01%2B1%15%29%1CStr0.png)

The increments are there to offset the length prefixes on those arrays.

To do something with this, let's loop through the array and all its arrays to print whatever is stored there:

(http://clrhome.org/homer/%3AClrHome%0D%0A%3AFor%28I%2C0%2C1%29%0D%0A%3A{{I*2%2BStr0}%15%1CK-1}-1%1CL%0D%0A%3AFor%28J%2C0%2CL%29%0D%0A%3ADisp+{J*2%2BK}%15%0D%0A%3AEnd%0D%0A%3AEnd.png)

With that, let's call it a day. Enjoy your newfound powers and happy coding!

[img]http://clrhome.org/
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Happybobjr on February 20, 2011, 01:44:10 pm
How do you deal with speed in axe, I have never gotten that :/
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Munchor on February 20, 2011, 01:45:44 pm
How do you deal with speed in axe, I have never gotten that :/

Speed like of the processor (MHz?)
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 20, 2011, 01:46:17 pm
How do you deal with speed in axe, I have never gotten that :/

When you move an object, just add more to its X/Y values to make it go faster.

And part 2 has been added! This'll be the last part for today.
Title: Re: Arrays in Axe (Bullet Code Tutorial)
Post by: leafy on February 20, 2011, 01:46:31 pm
Yay, Ive always wondered how to remove a certain object from an array.
Title: Re: Arrays in Axe (Bullet Code Tutorial)
Post by: Deep Toaster on February 20, 2011, 01:48:18 pm
Yay, Ive always wondered how to remove a certain object from an array.

Sorry, that's planned for part 5 or 6, so it'll take a while.

Next will be how to let the objects move around the screen.
Title: Re: Arrays in Axe (Bullet Code Tutorial)
Post by: Munchor on February 20, 2011, 01:48:57 pm
Speed:

Code: [Select]
Repeat getKey(15)
Pt-On(X,Y,Pic1
If getKey(1)
Y+1->Y
.Just change the 1 above to raise speed.
End
DispGraph
End
Title: Re: Arrays in Axe (Bullet Code Tutorial)
Post by: FinaleTI on February 20, 2011, 02:02:08 pm
(http://clrhome.co.cc/tutorials/whet/arrays/push.gif)

Looks good, but aren't labels only supposed to be up to 3 chars?
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 20, 2011, 02:03:06 pm
Dang, I've always used 2, so I didn't know what the limit was...

EDIT: Fixed.

EDIT2: Finished the first example program! Next I'll be explaining how to get rid of the enemy when it goes off the screen and how to make it shoot bullets :D

EDIT3: You know it's long when a post takes up half the page O.o
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 21, 2011, 09:41:12 pm
Added another section!

Yay, Ive always wondered how to remove a certain object from an array.

Well finally I've added it :) Look under "Getting rid of the extras."
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: ztrumpet on February 21, 2011, 09:58:57 pm
I love how it is so far.  Great job Deep!
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: leafy on February 21, 2011, 10:15:21 pm
Ooohhh, you use the Copy( and pointer before...ahhh, that's genius.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 21, 2011, 10:23:35 pm
And what's great is that you can easily change it a bit to remove elements of any size, and even remove multiple elements at once (for example if two objects are always tied to each other). There are even ways to make arrays of different-sized elements :D A bit hard to keep at a decent speed, but really fun to work with.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: DJ Omnimaga on February 21, 2011, 11:53:50 pm
Nice Deep! Some people wondered how to have games like shoot-em-ups before and were unsure because they didn't knew how to deal with arrays. Should be pretty useful!
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 22, 2011, 12:06:01 am
Nice Deep! Some people wondered how to have games like shoot-em-ups before and were unsure because they didn't knew how to deal with arrays. Should be pretty useful!

I think someday I'll convert this to a shoot-em-up tutorial that'll guide you through the entire process :D This is pretty close, anyway.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: DJ Omnimaga on February 22, 2011, 12:13:45 am
That would be cool :D
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: leafy on February 22, 2011, 12:44:43 am
Also make a tutorial for hit detection. I've never fully understood how to do it without checking every object and compare locations (or is that fastest way?)
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: ralphdspam on February 22, 2011, 01:53:47 am
Thank you.  This is quite useful! :)
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 22, 2011, 09:13:22 am
Also make a tutorial for hit detection. I've never fully understood how to do it without checking every object and compare locations (or is that fastest way?)

Yeah, I just cycle through and test it with the character.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: ee511 on February 25, 2011, 03:40:13 pm
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Michael_Lee on February 25, 2011, 04:17:00 pm
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!

*cough*

How about showing us your code first?  That way, we know what to help you with.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Builderboy on February 25, 2011, 04:18:33 pm
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!

Crashes in Axe are going to be frequent as you learn, did you have everything backed up?  And as Michael_Lee said, we are going to have to see your code to help :)
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: DJ Omnimaga on February 25, 2011, 05:47:54 pm
Yeah, ALWAYS backup (emphasis on always, and I mean backup every 3 minutes or so) on your computer while coding in Axe. Else you're gonna lose progress often. Also when asking help you should post code as Deep and Builderboy said, so we can see what could be wrong. Welcome on the forums btw!
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: ee511 on February 25, 2011, 05:50:42 pm
well, when I was working on this project, it was the only thing in ram at the time, and i had axe set to auto backup.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: ee511 on February 25, 2011, 07:06:16 pm
it's a lot of code, but here you go!!

Code: [Select]
:.SAND
:ClrDraw
:ClrHome
:Fix 1
:Text(5,10,"Zen Sandbox")
:Fix 0
:Repeat getKey(9)
:End
:ClrDrawr
:0→L
:0→W
:10→F→G
:0→{L1}
:0→{L2}
:Repeat getKey(15)
: If W>0
:  For(J,0,W)
:   {2*J+L2}→B
:   {2*J+L2+1}→C
:   Pxl-On(B,C)
:  End
: End
: For(K,0,L)
:  {2*K+L1}→X
:  {2*K+L1+1}→Y
:  Pxl-Off(X,Y)
:  If pxl-Test(X,Y+1)
:   rand^2*2-1→A
:   !If pxl-Test(X+A,Y)
:    X+A→X
:   Else!If pxl-Test(X-A,Y)
:    X-A→X
:   End
:  Else
:   Y+1→Y
:   Lbl RE
:  End
:  If Y>63 and (L>1)
:   conj(K*4+L1+2,-2,L-1→L-K*4+1)
:   Pxl-Off(X,Y)
:   Goto ER
:  End
:  If X<0
:   95→X
:  End
:  If X>95
:   0→X
:  End
:  X→{2*K+L1}
:  Y→{2*K+L1+1}
:  Pxl-On(X,Y)
:  Lbl ER
: End
: Pxl-Off(F,G)r
: If getKey(1)
:  G+1→G
: End
: If getKey(2)
:  F-1→F
: End
: If getKey(3)
:  F+1→F
: End
: If getKey(4)
:  G-1→G
: End
: If getKey(54) and (L<200)
:  L+1→L
:  F→{L*2+L1}
:  G→{L*2+L1+1}
: End
: If getKey(55) and (W<200) and (not(pxl-Test(F,G)))
:  W+1→W
:  F→{W*2+L2}
:  G→{W*2+L2+1}
: End
: Pxl-On(F,G)r
: Fix 5
: Text(0,0,L►Dec)
: Fix 4
: DispGraphr
: If getKey(56)
:  For(B,0,L*2)
:   0→{L1+B}
:  End
:  0→L
:  For(B,0,W*2)
:   0→{L2+B}
:  End
:  0→W
:  ClrDraw
: End
:End
:ClrDraw
[/tt]
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 25, 2011, 07:11:33 pm
Please don't use [code] tags in spoilers, it gets rendered into a tiny, tiny box in Chrome :( You can use [tt] instead. It's also fixed-width.

And try not to double-post within six hours. You can use the Quick Modify button at the bottom right of your post to add something.

Anyway, reading your code right now :)

EDIT: Is this your removal routine? conj(K*4+L1+2,-2,L-1→L-K*4+1)

You're using K*4 even though your elements are 2 bytes (I think).
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: ee511 on February 25, 2011, 07:21:33 pm
hee hee. whoops. let me fix that... yeah that doesn't work. it sort of shifts the screen over a bit, and then crashes the calculator... instead of crashing right away.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 25, 2011, 07:26:10 pm
hee hee. whoops. let me fix that... yeah that doesn't work. it sort of shifts the screen over a bit, and then crashes the calculator... instead of crashing right away.

Sounds like you're Copy('ing too many bytes... Can you show me what you changed the removal routine to?
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Ashbad on February 25, 2011, 07:27:20 pm
hmm, reminds me of a tutorial I was writing to actually implement Java-styled OOP with Axe, with instances, classes, and a slight bit o' inheritance, along with attaching methods and such.  If you want I can give it to you DT.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 25, 2011, 07:30:39 pm
hmm, reminds me of a tutorial I was writing to actually implement Java-styled OOP with Axe, with instances, classes, and a slight bit o' inheritance, along with attaching methods and such.  If you want I can give it to you DT.

I was writing a version of that too O.o I stopped so I could try my hands at writing an OOP Axiom. I failed at that too :P
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Ashbad on February 25, 2011, 07:31:28 pm
lol, nice.  I was able to get method attachment to work, but inheritance is proving tricky :/ though I have a hunch of how I might do it ;)
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on February 28, 2011, 08:16:09 pm
Update: I won't be working on this anymore because I feel like it explains arrays well enough. But here (http://ourl.ca/9422/179778)'s my tutorial on SHMUPs, if anyone wanted to see that.

EDIT: Just realized the images were broken because I moved them (again). Fixed.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on September 22, 2011, 11:41:42 pm
Seven months later, it's finally done.

Here are the changes:I've also updated the copy in the first post (http://omniurl.tk/6691/122244/) :)
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Derf321 on April 19, 2012, 05:37:32 pm
EDIT: Just realized the images were broken because I moved them (again). Fixed.
I'm sure this is a very good and helpful tutorial, but the images are broken again! Please fix!
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: AngelFish on April 19, 2012, 05:39:43 pm
The images show up for me...
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Deep Toaster on April 19, 2012, 06:44:40 pm
Not in the post here, whoops.

I fixed it, Derf321.
Title: Re: Arrays in Axe (Enemy/Bullet Code Tutorial)
Post by: Derf321 on April 19, 2012, 06:55:39 pm
I fixed it, Derf321.
Thank you very much Deep Thought!! Great tut!