Skip to content

Index of posts

Open this post for an index of most of the posts on this blog, organised by subject.

Read more…

If you are new here

I suggest you start at post number 1, because the early posts try to explain important Codea concepts, and because they are way simpler than the latest posts. (This blog has followed my learning process with Codea, so it starts off very basic, and grows with my knowledge).

Have fun!

253. Mapping with Codea

I recently built a little app to show the movement of families across an English county over a period of 80 years. Codea is good at this kind of animation, and you could do all sorts of mapping with it.

A video of what I did is below, but in this post I’ll talk more generally about how you might build an app like this.

(The red icons are births, the pairs of figures are marriages, and crosses are deaths).

Read more…

252. Snake!

This is the old snake game, as shown below. Joao_Lopes posted his version on the Codea forum, but got stuck on making the snake longer when it ate food. So, Joao, this is for you.

If you are fairly new to Codea, this may help you understand things like tables a little better.

Read more…

251. Fruit Ninja

I was looking for a new project, and then I wondered – “how hard is it to program something being cut in half, like in Fruit Ninja?”. Something like this

It turned out harder than I expected, but that’s good. I learned something from doing it, and I hope you will find it interesting, especially if you haven’t used Codea for very long, because there are some useful techniques.

Read more…

250. WoT – the end

It’s usually about now in a large project, that I stop. It may seem crazy, but it’s all because I don’t program to make finished apps – I program to have fun, to challenge myself and learn, and to share what I learn. Read more…

249. WoT putting tank detection in place

Having figured out how I want tanks to see each other, it’s time to see if I can build the system. I didn’t look forward to this, because there’s a lot of testing, and usually some difficult bugs, in something this complicated. Read more…

248. Optimising speed in Codea

Codea is amazingly fast. For example, it can run the tan function (which is not simple) between 100,000 and 600,000 times per second, depending on your iPad.

This means you rarely have to worry about speed, in most projects. But if you push Codea so hard that performance falls below 60 frames per second, you may need to improve it. And because some things run faster than others, there are some tricks you can use, as shown below.

Read more…

247. WoT – how not to be seen

This post is about how not to be seen.

Suppose I have two teams of tanks, with maybe 3-5 tanks in each team, and only one is a human player, all the rest being bots. So I have 5-7 bot tanks running around trying to see and shoot each other.

How do bot tanks see enemy tanks? It’s not easy. But this challenge is the main reason I took on this project, and it hasn’t disappointed me. It’s really interesting.

Read more…

246. Optimal culling

While trying to figure out how bot tanks saw each other, I revisited culling (deciding which objects to draw), and it proved an exciting adventure that resulted in some blazingly fast code, which I’m happy to share with you now.

Read more…

245. WoT – Self driving tanks that don’t collide

A playable demo is coming soon, but I have to sort out a few things first.

Initially, I’m going to have the enemy tanks drive around in random directions. Obviously, I don’t want all the tanks to drive through each other, or to drive off the edge of the map, so I need to program some behaviour for them.

Like this (a test with many tanks so there are lots of collisions).

(I realise the other tanks don’t avoid my tank, and drive straight through it, but that’s because I still have to program special behaviour for that, like shooting at me!).

Read more…

244. WoT – Shooting Damage

Now that I have shooting controls and a way of knowing where a shot hits, I can think about damage.

There’s a video at the end of the explanation.

Read more…