Recently, I made flow for the nspire in lua. The game is pretty much done, but it is severely lacking in levels. I don't know how to attach files and I will need to wait for approval to upload the game to this site(it is already on ticalc.org though, and my username there is semiprocoder), which is why I can't put images(also don't know how to do that).

EDIT: 300 levels, that vary from 5x5 to 14x14. Jonbush gave me all the levels that are in the game right now.

The code for the level editor is not in the nspire, and it is not done yet. It is made in processing and has to run in processing, because it relies on you being able to change the code(to change the board size you have the change the variable. Also it prints the level string to the console so you have to copy and paste the latest string made from the console, which is annoying to do(but I will make it save to a file once I come around to it). Here is the processing code:

Code:
[ELIDED BY EDITOR]


And here is my readme, which should describe this a bit more:

creator(s):
Andrew Krapivin, email: andyhsstudent@gmail.com
contributor(s): none for now. This will be updated if someone sends me some levels

Overview
Hi guys. So I decided to start remaking some fun and simple android games. I just finished my first working version of flow. It runs much faster than my other games. It now has 10 5x5 levels and 5 8x8 levels and I plan to have 10 5x5(as I have now), 10 8x8, 5 10x10, and 5 variety, for now, unless someone else also decides to make some levels.
Controls
As for the controls, you move the rectangle with the arrow keys and click on a circle to select it's color. Then you aim it to the other color circle. The aim is to fill the board and connect all the circles. When you win the board you can press enter to advance to the next level by pressing enter. Hope that made sense.

Making and Submitting levels to me
If you want to make levels use this code in processing. To add a new flow dot, just click on the square you want and it will go through all the colors currently available. If you want to change the size of the level then just change the boardSize variable to whatever you want. To actually play your level(sort of it is not as polished as flow) you press the right arrow key(and to go back to editing you press the left arrow key). Then while playing you click on a square with a full flow thingy, which selects the color, and then you click anywhere you want to create a smaller circle on the square you clicked on, which represents the path. To reset the board, simply press R.
Then, to actually submit what you created to me, just shoot me an email(listed above) with the latest string that was printed to the console. If you want credit then submit 5 or more levels(any size) and I will list your email under the contributors.
Thanks for posting! May I please ask that you upload your game to the Cemetech Archives rather than putting the code in the post? Thanks in advance.
awesommee333 wrote:

First off, I am asking for new levels because I have 10 5x5 and only 5 8x8 levels. I need more of those and I need 10x10 levels and some variety size levels.


earthnite and I have been working on a project called TI-FLOW for some time now. As part of the process, I made a Java application to convert levels to our compression standard in bulk (among other things). If you are interested, I could possibly program a new Compression class to interface with my application and convert levels for you. I can make levels of any size between 5x5 and 14x14 as long as I know how you are storing the level data. See TI-FLOW.
Yeah. That would be great! Thank you. I am storing each level in a table. First goes the size(like 5, 8, or whatever), then goes the string. Then, the string has to have size^2 numbers in it. Each color of dot is represented by a different number(1 is red, 3 is blue, and so on with other colors(even numbers are used for the line of the color before it)). Each row(or column I forget which one is what) is separated with a space, and each element in the row(or column) is separated with commas.

Ex(for one of my 5x5 levels): {5, "0,0,0,7,5 0,0,0,1,0 0,1,5,0,0 0,9,0,9,7 0,0,0,0,0"}

The 5 is the size. The rows are separated with spaces, and the numbers are separated with commas, and the zeros are just placeholders where there is nothing there.

Here are all the color values my game supports so far:
1->red
3->blue
5->green
7->yellow
9->orange
11->light blue
13->dark red
15->dark green
17->pink
19->violet
21->gray
23->white

It is not too hard for me to add new colors, but due to some bad coding that will take a while to fix if I were to do so it will require some copy and pasting and replacing.
awesommee333 wrote:

Ex(for one of my 5x5 levels): {5, "0,0,0,7,5 0,0,0,1,0 0,1,5,0,0 0,9,0,9,7 0,0,0,0,0"}

The 5 is the size. The rows are separated with spaces, and the numbers are separated with commas, and the zeros are just placeholders where there is nothing there.


This should be fairly easy to when I have the time. How many levels would you like? I can also try to pick only levels with 12 or fewer colors.

So far, it will probably be something like:


Code:
String lvl = "{" + size + ",\"";
for(int i = 0; i < size; i++){
    for(int j = 0; j < size - 1; j++){
        lvl += board[i][j] + ",";
    }
    lvl += board[i][size - 1] + ( i != size - 1 ? " " : "\"}" );
}
Yep. Seems about right. Lasts line is broken though. Change
[quote="jonbush"]
lvl += board[i][size - 1] + ( i != size - 1 ? " " : "} )";
[/quote]
to lvl += board[i][size - 1] + ( i != size - 1 ? " " : ""} ");
There was no end quote and end parenthesis was inside the quotes. Other than that it seems great.

I forgot to mention at first that I plan to hae 50 5x5 levels, 50 8x8, 50 10x10, and 50 random size levels, but that is quite ambitious and I don't expect you to give me that many levels.

Thank you again for helping me. The makers of flow free were not as willing to do so(I sent an email asking them and they rejected me).
I was thinking about somehow randomly generating the levels, but I have no idea how to do that to make them always winnable, because if I could do this I would just have a separate random mode. Considering that even the full android game does not have this feature, I don't see this being definately possible, and as I have no idea how to do that at the moment, I was wondering whether anyone has done anything similar to this in one of their programs and could perhaps help me with a random generator for levels. They don't have to be hard or anything, they just have to be beatable.
I have ported all of the levels you requested. They may be found here: https://drive.google.com/folderview?id=0B4NeRqz83bbDaFB2T3JPZm9tNTg&usp=sharing

If you have any questions, or need something corrected, just ask.
Wow! Thanks so much! This makes my game actually worth playing now! I will definately credit you for the levels. Also, can you give me a few(like 5 or 10 of each or something. I mean it would be great if you could send me fifty. Also could you send me the source for your code you used to make my levels, cause I want to use you level editor. It is way better than mine.) 12x12 and 14x14 levels? I want to have some really challenging levels and I want to see how they center. Thanks in advance.
I'll probably upload the additional levels later today or tomorrow. I can also try to make the Pack Creator work with your formatting algorithm, but designed around my compression method more than the program that I used to port the levels. I also think I will have to regenerate the levels I previously posted because I did not account for the color numbers. You may want to add at least four additional colors, because some of the larger boards have over 16.
Alright. I will add more colors. The color numbers are fine I just multiplied by 2 and subtracted 1, except for 0, so it still works for me.

By the way, do you feel like this is odd how all of these calc flow games are being developed simultaneously? And for the ce version will you use colors or will you still use letters?
awesommee333 wrote:
Alright. I will add more colors. The color numbers are fine I just multiplied by 2 and subtracted 1, except for 0, so it still works for me.

By the way, do you feel like this is odd how all of these calc flow games are being developed simultaneously? And for the ce version will you use colors or will you still use letters?


We plan on using colors for the CE version, but our compression is independent of what is displayed, so it should be relatively simple. I have updated the levels that I shared with you before and added 12x12s. You can find the source code for my image conversion project here. I haven't commented it, but I may do that eventually. The pack editor is closed-source for now, but it uses some of the same framework as the image converter.
Thanks! I didn't add them in my current release I'm waiting to be approved for, however, because I didn't see this reply. I want to test a few levels before I upload it, as 10x10 had a color glitch that I fixed. Furthermore, I think I will revamp my code to work allow for adding colors, and, more importantly, make the code easier to navigate, but for now I will just support 18 or so colors. Also I'm confused. What do you do with images? I thought this was compressing levels, so what does it do with the RGB values?
awesommee333 wrote:
Thanks! I didn't add them in my current release I'm waiting to be approved for, however, because I didn't see this reply. I want to test a few levels before I upload it, as 10x10 had a color glitch that I fixed. Furthermore, I think I will revamp my code to work allow for adding colors, and, more importantly, make the code easier to navigate, but for now I will just support 18 or so colors. Also I'm confused. What do you do with images? I thought this was compressing levels, so what does it do with the RGB values?


The classes that implement Compression do the compression. PackConverter prompts for a directory containing screenshots of Flow Free levels, iterates through with a for each loop, and then adds a new Level object to the ArrayList<Level> for each image. The setFromImg() method accepts the the image and then process it and sets this.size and this.levels. The PackConverter also contains other methods to apply certain operations to the levels after they have been processed. After any extra operations have been applied, the pack is passed to the packToString method of a Compression object, which processes the nodes and returns a string in the specified form.
Oh, so you use the actual flow free levels? Also, I think that level 3 of the 12x12 levels(not sure there might be others only at lvl 3 right now), is not properly working. It has a 15, which translates to 29(that I cant display), while all the other numbers seem to be under 10, and it doesnt have any other 15s.
awesommee333 wrote:
Oh, so you use the actual flow free levels? Also, I think that level 3 of the 12x12 levels(not sure there might be others only at lvl 3 right now), is not properly working. It has a 15, which translates to 29(that I cant display), while all the other numbers seem to be under 10, and it doesnt have any other 15s.


I changed it so that you don't need to multiply by 2 and subtract 1. The numbers are translated into the following strings:


Code:
private static final String[] colors = {"0","1","3","5","7","9","11","13","15","17","19","21","23"};
But then why are there 2s and 4s in the levels?
awesommee333 wrote:
But then why are there 2s and 4s in the levels?


Because I am dumb. I forgot to change part of the code, so the currently uploaded levels are invalid. It was using temp[r][c] instead of colors[temp[r][c]] for the for all but the last number in each row. I'll update the levels in a few hours. Sorry about the confusion.

EDIT: Everything in the Drive folder should be fixed now. I also added 14x14 boards, but the colors go up to 31, so you might have to pick through them unless you add more colors.
Ok so I finally implemented everything. I now have 300 levels, with 50 levels in each pack. The sizes of the packs are:

5x5
8x8
10x10
12x12
14x14
and Variety
all adding up to 50*6=300.

Some new features I plan to add(but don't garauntee as I want to work on more games like sudoku and learn to fly idle for the nspire) are:

better colors(some are too dark and are kind of hard to see)

greyscale(although I have 0 idea how to implement this, as I don't have a greyscale nspire and will have to search up how to program one)

revamped api(which I may never do, but should, as ~700 lines of code could be implemented in ~40-50 lines, and although it does not change performance, it would be easier to navigate.

better centered circles and lines for smaller level sizes(10x10-14x14)

a more functional level editor that creates the text for a file to be placed in mylib.

more info on the side

improved in between level menu

(Here are some of the images of the game:

)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement