Dragging Sprites

So I’m brand new to Codea, and want to build a basic game to start off with. In a nutshell, you drag your sprite though a maze to reach the end and go to the next level. But my question is, how do you drag your sprite without using the touch function? This was in a tutorial I used, and served the purpose but the fatal flaw was that it allowed the player to tap somewhere and the sprite would appear there, therefore eliminating any need of going through the maze.

So I’m wondering, is there another function I can use to touch and drag my sprite without being able to tap somewhere and it appearing?

Also, if there is a function which allows sprites to become like walls, so you can’t drag your sprite through them, I would really appreciate knowing this :slight_smile:

Thanks so much, really excited to be diving into the wonderful world of coding

You could have a look at my game ‘Kraizy Circles’, the 4rth post on my site http://jmv38.comze.com/CODEAbis/server.php . I drag the path on the screen, it is drawn. It is about what you want to do in your maze. Then when i ‘run’ a ball is following the path, and if it touches another ball, boïng! You can see how i manage the collisition of the ball with another, and adapt it to sprite to wall collision.

You control what touch does. It doesn’t have to instantly move the sprite.

I have a tutorial here (and many others besides).

If you are new to programming, I strongly suggest you learn something about Lua first (it is the basic language behind Codea).


And then do some Codea tutorials (see wiki link above).

Don’t worry if it seems confusing at first. We all feel stupid at the beginning, that is quite normal. It is worth it, because Codea is a lot of fun.