Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: tifreak on March 21, 2013, 08:12:10 pm
-
Recently, I started in on a port of Connect 4 for the 84+CSE. It seemed only logical that this game make its debut on this color screen.
As it stands right now, here's what I've got:
(http://tifreakware.net/tifreak8x/connect4/connect4.5.jpg)
Got to make sure all the holes fill properly, and the list values are correct, don't I? :p And they of course, did.
(http://tifreakware.net/tifreak8x/connect4/connect4.5anim.gif)
This was taken with Calc Capture. It doesn't like color, it seems. Anyways, the calc is a little bit faster than this. And I might be changing the board to blue and removing the background image, since I'm going to want to use Text on the same screen while playing.
Next up is to set up the testing to see if there is a winner.
Just thought I'd post this up here, now that I actually have something substantial to post about.
Credit to Kerm for writing up the code for the boxes and circles drawing code.
-
This looks really cool. And yes CalcCapture destroys colors D:. I was a bit concerned about the speed but then I remembered that on emulator+CalcCapture it was always slower than the real thing.
I would probably either keep the board yellow and add some dark background or do like you said. Anyway nice job so far :)
-
wow, that is looking slow, but the color makes it pretty! :)/me wonders how quick it could get with assembly
-
Sorunome, the board takes 35 seconds to draw, and everything else is fairly instant.
DJ: I do have a background in it, look at the other screenshot above it. :p But having the background means if I display text over it, it leaves blocks of white behind the text, and makes it look not as nice. Hence switching to blue and getting rid of the background.
-
A couple things: Is that the circles command you're using to draw the board and pieces (it seems to draw a bit differently). If so, are you using the fast circle trick?
-
No, it's a custom thing Kerm set up for me, draws the boxes with empty circles, and there is a filled circle routine posted in the basic routines section on Cemetech. The fast circle trick does not work on the CSE. :<
-
Ah ok. That's a shame. :/
-
Speaking of faster circle trick, does the large-font trick still work?
-
Yep, just tested :
(http://i.imgur.com/3DlN7NP.jpg)
-
This can also be recreated if you use the following syntax, and this is something I recently discovered:
Compare the following two:
Circle(0,0,10 makes a slow circle at origin with a radius of 10.
Circle0,0,10,{-i} makes a fast circle of the same dimensions. The i is the imaginary I. Test it on the CSE please!
-
Dapian, it doesn't work. It was removed because they added the color syntax to it. The circle drawing routine is actually faster than what it used to be, though.
As to my project, I've started in on win detection. Going to be fun to implement. :p
-
This can also be recreated if you use the following syntax, and this is something I recently discovered:
Compare the following two:
Circle(0,0,10 makes a slow circle at origin with a radius of 10.
Circle0,0,10,{-i} makes a fast circle of the same dimensions. The i is the imaginary I. Test it on the CSE please!
This is what I mentioned a few posts up. It's refered to as the "fast circle" trick.
-
Dapian, it doesn't work. It was removed because they added the color syntax to it. The circle drawing routine is actually faster than what it used to be, though.
As to my project, I've started in on win detection. Going to be fun to implement. :p
I am still curious about if the trick if still present in the TI-OS code, though... I wonder if anyone has looked at the OS disassembly yet?
-
No idea. :<
Update so far today:
Win detection works and is confirmed on at least 3 directions, so I'm going to assume it's fully functional. I will be doing finalizing tests, of course.
I'm going to add some text here and there to kind of fill in the emptiness (since I'd like to have a title and who it's by on the screen somewhere) plus I need to make it so that when it is won, it will clear the tokens out and let you start over.
I think I might scrap the AI idea I had. That's going to severely bloat the code. I might give it a shot for a future version, who knows.
Edit:
(http://tifreakware.net/tifreak8x/connect4/connect4.6.gif)
So, what I have left to do:
1. Make it so it will clear out the spaces that are used
2. Make it so you keep on playing instead of dropping out of the program
3. Make the tokens fit the holes better
Thoughts?
-
Nice stuff :). By the way after looking carefully at the animated screenshot, do you think you could make it so when you move the coin around, it is erased with "Text(-1" instead of line by line?
-
DJ: I had considered it, but never bothered to try it. Just trying to keep things uniform. And I'm not sure that Text(-1 trick is tall enough to cover the coin. I might look into it, I was just trying to keep it looking the same being deconstructed as it was being constructed to the screen. The thing isn't that slow on calc. Hopefully someone else with an 84+CSE can test it and agree to it :p There is also the issue with having to keep track of 2 separate coordinates for the coin and clearing the coin. This, surprisingly, used up a lot of variables to make.
-
Yeah I thought about two spaces for Text(-1. It would definitively look more consistent with the coin animation removed, though.
-
That color screen just makes the game look so beautiful :)
-
Thank you, Sorunome :) I'm hoping that others will find it equally appealing. Going to try to set it up so that the animation goes away and it can display a simpler board, for those that want it. Though it's going to be defaulted to all the fancy stuff :p Pending I can make it work. Otherwise, it will just have the full board and be done with it.
-
(http://tifreakware.net/tifreak8x/connect4/connect4.7anim.gif)
(http://tifreakware.net/tifreak8x/connect4/connect4.7anim2.gif)
All that I think that needs doing is fixing the circles and making it so it doesn't show the animation!
-
Looks quite nice actually. I liked the other version better but this one is faster. :)
-
You get to choose your boards, this is just the simple one. Default is the nice board that takes 30 seconds to generate :)
-
Lookin' good tifreak!
I'm wondering if the CSE has a solid circle already in it's ASCII table.
-
(http://tifreakware.net/tifreak8x/connect4/connect4.8anim.gif)
So! Fast drop works! Found out I need to have it detect from the middles as well! SO! I am going to spend some time expanding the win detection. And then Weregoose can say oh hey, let's take that 1kb of code, and make it 3 lines! And I will walk away in shame. ;) lol
Anyways, on to making the circles prettier.
Edit:
(http://tifreakware.net/tifreak8x/connect4/connect4.8anim2.gif)
Circles are now the same as the ones 'cut' out of the other board. Only thing I need to do now is to check for winning when the piece falls into one of the two possible middle spots for the 7 directions. Should be fun.
Edit 2:
Added the remaining win checks:
(http://tifreakware.net/tifreak8x/connect4/connect4.8anim3.gif)
And it doesn't seem to error out where ever you decide to drop the coin, so that's a good thing. Going to try to do a little bit of polishing work with it before I drop it for a public beta. Plus the Readme and all that.
-
I've uploaded Connect4 to Cemetech Archives and ticalc, it's awaiting approval there.
http://www.cemetech.net/programs/index.php?mode=file&id=884
-
So yeah I tried this a few weeks ago and you did a quite nice job :). Of course those who want the board to load fast might prefer using the simple mode, but otherwise the slower mode looks even better. :)
-
Thanks DJ :D I tried to make it the best it could be, without being ASM. :)
I'd also still like to add AI at some point, it's just not on the top of the list of things to do, want to get other things done so I can get back to pokemon!
-
Looks awesome! :D
-
Thanks! :D It plays faster than what the screenshot shows, as well!
-
Looking pretty awesome, it is nice to see already games for that new calc :D
-
Have to get on top of things now while the getting is good, before others go out and throw their versions down :)