Flood It

Hi @veeeralp,

Just a couple of things -

First - when I cut and paste your code I always get errors for style().
This looks like you have an imbalance in your push and pop setup as, when I correct it it works fine for me. Are you trying to nest push and pops?

Should be in order pushStyle() then popStyle(), ignore this comment if it’s obvious.

Second - I notice you’ve increased you grid size from 14x14 to 17x15. This is a change of 196 cells to 256. That’s quite a big change and I’ve found the target of 25 too small. Think you may have to increase ti pro-rata to say 33 (rounding up). You may have to play with this to get a good balance.

Finally, I’ve posted your code on my github site, to help people download. The problem with loads of code in posts means it ends up in lottsa pages for a thread - which we have to negotiate - fustrates me. Ought to post in reverse order i.e. latest date first, like the main forum discussion list. Collapsible code would help as well.

You may be able to update the listing yourself, as it’s in a public gist (never tried this myself), or make a fork off it. If not - if you post changes to the code I’ll do it myself.

link is : https://gist.github.com/3075538

Noted you’ve put a timer on yours - toying with the idea for mine.

Thanks again,



@Bri_G I’m new to coding so I have no idea what pushStyle() and popStyle() is. I just used it as a guideline from the code in the examples. I don’t know what nesting push and pops is. Did you fix this in the code you put on github? Also, I’m having trouble making it say that you win. I tried to use conditionals (like you), but it doesn’t work for me. Also is there a way to make sure the timeLeft doesn’t go under 0 and pauses when the the person loses. I made a zer0 appear over the actual timeLeft but how would I make the timeLeft disappear once it goes below zero. Thanks and I’ll try to update my code through gist.github. If not, I’ll post here. How’s your code lookin?

@Bri_G I fixed the pushstyle() and popStyle() thing you were talking about by looking at the gist.github post for my version 3. In the above post I was talking about v4 so here it is.
I need help on this one.

Also, I put it to countdown from 10 so you know what I’m talking about

Hi All,

Just a note to post a video of the Flood-pad app I have written, based on @Eric’s original code. The app is still in development - currently working on HiScore table. Then needs debugging, but is almost there. Will take a few weeks due to arrival of Hols (kinda reverse logic - but I have less time during hols than during rest of year!!!).

This post just to show @veeeralp my progress and what you can do with Codea in this app.

The vid:


Enjoy, code will be released when I have the total package - before optimisation and clean-up (or it will take months!!!).



I love your app. I stopped working on it and focused on another game. After I’m done with that, I’ll work on this.

PS. How did you create thos fancy fonts?

Hi @veeeralp,

Thanks on the app front. Code to follow when I finish the his core table. On the fancy fonts front, I’m assuming you mean the app title, I made those with Xara Photo and Graphic Studio - it’s got a built in 3D font functionality which you can then convert to vector objects and export as png or jpg.

I’m working on other apps which will be posted later.



@Bri_G ok cool. ill probably just use adobe illustrator and photoshop once I get back to school. Also, does your project have any sound. I wish the recorder recorded sound. how are you going to implement high scores. I was looking at @Vega’s post and was wondering how you would let the user type in their own name?

Hi @veeerlap,

You’ve it on two of the things I haven’t done yet. @Vega’s post is my starting point. Hope to sort this out over the next 3 weeks.

On the sound front we need to be able to play sample files. Is there any help from the Carg-Bot example code?



@Bri_G, Cargo Bot does not use audio samples, but you can see the sound effects we chose and how the music works. To hear it you will need to set the nosound flag to false in main.

@Bri_G and @veeeralp - if you want some sample high score code have a look at this tutorial: http://codeatuts.blogspot.com.au/2012/07/tutorial-7-minesweeper-part-2.html

It uses the textBox class from Spritely to enter the players name for the high score and then saves it to local data with the score.

@Reefwing ok thanks. I’ll look into that. The only problem with that is that you won’t be able to see other peoples’ scores. Only yours

@veeeralp - true, you need something like @Vega’s solution to have a global high score but at least you can see how to use the textBox class to enter a player’s name.

@Reefwing ok thanks will do. Are you gonna make a tutorial about submitting your minesweeper app to the appstore

@veeeralp - yes indeed.

I just got side tracked with the new dependency functionality. I’m going to tidy up MineSweeper using my new RSLibrary and then I will have a shot at this.

@veeeralp, a while ago I started working on a “Pop up dialog” with text input field. I found the code and have just published it here (as it is) http://sprng.me/f7phd. It is a mess, non-polished code, I know, but the basic functionality is buried there somewhere. If it can save you some typing it will be worth. BTW, question for all and specially for @Simeon: Is it worth writing our own windowing system for Codea or are we going to have pop-ups, buttons, input fields, menus, etc natively in Codea any time soon?

I have a fairly extensive UI system available from http://www.math.ntnu.no/~stacey/HowDidIDoThat/iPad/Codea.html with menus, various buttons, text boxes, and so forth.

Thanks for sharing @Andrew_Stacey, I’ll give them a go.

how did you end up making it work in both orientations. Right now, when I change orientations while the game is running my buttons get messed up. But when I press the reset button in the new orientation it gets fixed. I’m worried on how it will actually look once in xcode

. @veeeralp - you need to define the orientationChanged(newOrientation) function and adjust your button (x, y) co-ordinates in there so that the next time they are drawn they are in the right spot for that orientation.