Looking to create a game like this http://www.agame.com/game/4-in-a-row
Have anyone ever created something like this?
Found this to be an interesting challenge.
It's just a basic version and it might contain bugs, but it mostly works as intended.
The actual challenge was the win-detection algorithm.
Here is the download to the .capx.
It is by no means perfect, there are many ways to make the win-detection algorithms faster and more effective.
Two things that I thought of:
These features are easily implementable, but I didn't have the time to put them in.
Hope this helps.
It looks pretty good but there is a major issue. You will win if there is 4 in a row but there is a gap between them.
R0J0hound would you be able to help?
I have an example for detecting match (3 or 4) >>
Works for horizontal & vertical match not diagonal but somehow you can just modify it to your needs.
Your example is good but I am not sure how I can implement on the capx randomly provided. can you please give us some clarification?
Perhaps I will start making this kind of tic-tac-toe game after the jam ended.
Fixed the horizontal check and improved vertical check.
I was just thinking too complicated, trying to make smart loops, but could have instead just used brute-force conditions.
Which I did now, inspired by alextro .
Same link, different file: Download here
One last thing that I need to figure out is, why the dictionary with the supposed check results always contains only one key when moving to the "win" layout.
But that's not important.
Important is that the main engine runs now.
Good but not perfect yet. I am still getting false wins
I'm not gonna dig any further into this, this is your project after all, not mine. ;)
Yes randomly has provided decent sample for everyone who want to learn the logic. It can be perfected by himself or other user by the time. At least he shown a good sample as starting point.
Users requesting help should be reminded of Tom's useful 'Tips for Posting' sticky, especially the first item:
[quote:2a6whz78]1. We want to help, but we're not here to make your game for you. It's best not to ask too much!
Some learning and development from the provided examples is always a good thing
If a user is still stuck after trying to get what they want then it's best to post what you have done for others to check - they may spot simple errors much quicker that way.
Develop games in your browser. Powerful, performant & highly capable.
As promised here my best attempt for tic-tac drop: https://www.dropbox.com/s/wgfhlw92p4w9z ... .capx?dl=0
wow. It looks great. I will try to implement the AI for the computer to play as the second player. thanks a lot!