Touch Controls Vol II. v1.2 [Cralant edit] Commented

Cralant - Custom level - from Android
PlayEdit4 players liked this.Log in to like this level.

Added the toggle or tick addition. 1 to toggle and 0 to tick, this has become the third value so to add a new entity use {17,5,1} .

Now heavily commented, everything should be explained. If anyone has any queries, suggestions or ideas let me know.

Was really impressed by the original idea and implementation. Edited the original code for much better optimization, all information is now stored in tables, makes for a much smaller script and easier to add new entities. To add new entities just add a table with the entity id and the frequency. e.g: {99,5}.
The rest is all automatic.

Tap or click an object to activate it, for some reason the switch isnt hightlighting...(update:added a flashing sprite)

This is a simple lua Cursor Field which is centered on an object. Also added the new highlight feature, hopefully that will help the non-english speaking folks figure it out.

Views: 819 Downloads: 123 Unique objects: 14 Total objects: 24


Discuss this level

Log in to comment on this level.
  • zardOz2: @Cralant: ahh thanks, I think I have it now... Tis was very helpful tanks again.
  • Cralant: @zardOz: You could use entities[number][10] = true. Number being the number position in the table. Or perhaps I could rearrange the default table to make it the fourth entry so you could have {Input Frequency, Output Frequency, Toggle/tick, Current state} Which would be easier if using for multiple values.
  • zardOz2: @Cralant: so I see you added [10] toggle as an "initial state" but I'm not clear on how to set it.
  • zardOz2: Er "press and hold"
  • zardOz2: @Cralant: I just updated mine with toggle/pred and hold... good luck with yours
  • Cralant: Ok now that commenting is out of the way I can work on the toggle, it may bulk up the code a little but let me see what I can do.
  • zardOz2: Comments would be wornderful, you're codes are always helpful. One thing I was gonna work on was a "Toggle on until touched again" option for certain things like the rocket... not sure how you would put that into the automatic code, perhaps a third number in the table 0=tick,1=toggle something like that.
  • Cralant: No problem, I loved the idea but thought it would become to bulky to add multiple objects so I tried to simplify it as much as possible. If you need me to explain any parts I would be happy to. Perhaps I should comment the code?
  • zardOz2: I see, very cool thank you... I still can't figure this method out, of course I havent tried very hard.

LEVEL ID: 3745