TouchLine

I thought I’d do a quick extra post to show people my competition game. It’s called TouchLine.

TouchLine title screen

The basic idea is that you move a line around the screen using two fingers (it’s best to play with two hands to get the best view of the screen), and avoid obstacles for as long as you can. Take one hit, remove either finger, or make the line too short, and it’s game over.

TouchLine gameplay

There are a number of power ups (would’ve liked to add more, but ran out of time):

  • Slowdown (slows down all obstacles for 10 seconds)
  • Shield (allows you to take a hit and keep playing)
  • Zapper (lets you destroy obstacles for 10 seconds, for extra points)

Here’s a YouTube video showing it in action: http://www.youtube.com/watch?v=ih6IE2bZOQI

I’ll post code soon. I also want to extend and separate out the Tween class I started to put together for this. It basically allows you to pass the name of a property, a starting value, a finishing value, and a timespan, and will then animate the property between the provided value for you. Hopefully other people will find it useful! I also created a starfield backdrop - I know there was a discussion abut that sort of thing on here the other day.

I think this game mechanic is really clever. Though one thing I notice is that there’s not often much advantage to extending the line — or do you get a larger point multiplier the longer the line is?

If I had known you were making a Tween class I would have sent you @John’s Tweener! He’a built a similar thing. He came up with a really clever way to hook into the draw() loop using just Lua (so you never have to actually call an update method). We are thinking to integrate it into an upcoming Codea version once the API is stable.

Wow… That is the coolest thing EVER! Haha- I like how you were using the dark theme in the beta. I can’t wait to play it. It looks like one of my favorites in the competition. :slight_smile:

I like the effect at game startup. Do we have to touch by using two fingers all the time? Can we use just one figure to move it and use two fingers when changing size or turning the line.

Building on @sanit’s idea, when using one finger, with the physics, the line slides around your finger like it’s on a slippery pan. This is a game I could really see on the app store being a giant hit. It’s amazing Love it.

Thanks for the comments, guys!

@Simeon Yeah, you do get a score multiplier the longer the line ism- but you’re right, it should give you feedback and be far more obvious! And probably a bigger multiplier, too…

My Tween class was only very simple - I just used loadstring() to increment a property that was passed in by name (as a string). Would like to add more, but if you’re thinking of adding @John’s into Codea, that’d be excellent. I’d be interested in seeing his code, if that’s okay?

Another similar piece of functionality that I’d find really useful would be a way to delay an action / method call. I find I end up having to create a load of timers variables to check a certain amount of time has elapsed before doing something.

@sanit You do currently have to use two fingers. I quite like your idea though - the main problem when you play with two is that you hand often gets in the way. It’s actually easier playing with both hands.

I’ve also found a need for scheduled events and implemented my own scheduler. It would be great if Codea provided a scheduler. Something like:

local scheduledEvent = schedule(1.5, myCallbackFunction, x, y, z)

Would call myCallbackFunction after 1.5 seconds passing it x, y, z as parameters, returning an object that can be used to cancel the event.

Being able to schedule repeating events as well would be even better.

@Nat John’s tweener library has a delay, sequence and repeat actions. It can also accept arbitrary functions as part of animation sequences, so you can construct the following:

event = sequence( delay(1.5), function() myCallbackFunction(x,y,z) end )

It must use closures instead of argument forwarding, as the sequence already accepts an arbitrary number of parameters.

It’s quite a powerful library. I’ll see if I can get John to post a thread about the code so people can play with it before it’s integrated officially.

Here: I embedded the video:

I don’t know which is better, TouchLine or Help the Fish… it doesn’t matter… They are all by far (in my opinion) app store worthy apps. If only we had Xcode export now…

@Simeon I just tried added a score multiplier display, and I think it really helps the game. Thanks for the suggestion!

That’s just a really clever idea, clean and simple. I’d buy that for a dollar. (but hey, I don’t have to!)

How about $2? I would

Thanks for the encouragement, guys. I’m thinking about either trying to release the game using the Codea engine when that’s open sourced, or porting it to Cocos2D or similar.

Can we eventually have the code? Thanks!

^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^ ^:)^

We all hayoll you…you ar god of codea

Very nice. Extra points for the starfield - every game needs a scrolling starfield!

nice title screen as well.

I always have an issue with games like this because my hands get in the way.