kenrick95 / c4 Goto Github PK
View Code? Open in Web Editor NEW๐ด๐ต Connect Four game in JS + Canvas
Home Page: https://kenrick95.github.io/c4/
License: MIT License
๐ด๐ต Connect Four game in JS + Canvas
Home Page: https://kenrick95.github.io/c4/
License: MIT License
At README.md, "Browser compatibility" section, it still mentions
Require browser that supports ES2015's Promise.
This line at README.md should be removed because I have already included a Promise polyfill in https://github.com/kenrick95/c4/blob/master/src/app.ts#L1
Not sure if it counts as a bug, but I find it too obvious.
Just placed that red on the 6th column and the game put a blue on the first. Or was it by design?
Log, if can help: http://pastebin.com/AAAjUXEw
It can be solved, just replace draw in function animate:
if (to_row * this.circleRadius >= cur_pos) {
this.clear();
//this.draw(); current call position
this.drawCircle(this.circleRadius * column + 50, cur_pos + 50, 25, fg_color, "black");
this.drawMask();
this.draw(); // call draw() there to solve radius changing
window.requestAnimationFrame(function () {
that.animate(column, move, to_row, cur_pos + 25, callback);
});
} else {
callback();
}
It would be nice if one could play against another human over the network / Internet or however they have access to the server running the game. If you plan for something like this on your own, I encourage you to implement this.
If you do not plan this on your own yet, I am willing to make this my own task and submit a PR when I am ready.
Please let me know what you think about it. :)
Hey,
I am new to TypeScript and open source and I found your game to be an amazing repository to learn and practice TypeScript by refactoring and writing tests for your code.
I would like to contribute a little to the repo on a daily basis and would love it if you could review my code daily and suggest changes.
When column is full, player can still choose the column and the game hangs (game state does not change, no player can do action).
it would look nice
I would like to translate this project, even though it is simple enough. I want to share this project with my friends who are not very good at English, how do I go about doing that? Thanks!
One more question, can this project be done through web server only, using yarn to run the project is not as easy to manage on the server as on the web. I really like this project and would like to get a reply.
On the README
section, after installing dependencies, it is said to generate dist/
folder and open index.html
in the browser.
I saw that #7 moved the project to Parcel. Hence, simple yarn start
should suffice and it will even enable live reload. Available at http://localhost:1234/
Allow users to input a username when they start a game.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.