nus-alset / games Goto Github PK
View Code? Open in Web Editor NEWGames based on React Game Kit
Games based on React Game Kit
Users can click on the result of any head-to-head match to play a given bot as player 1 or player 2.
Currently, this is achieved by href on A tag. There needs to be a method pass to the element from the parent component that will be responsible to re-render the game with selected controls.
Refer to this code
https://github.com/NUS-ALSET/games/blob/master/src/squadSinglePlayerGame/src/simulation/table-result.js#L94
https://github.com/NUS-ALSET/games/blob/master/src/squadSinglePlayerGame/src/simulation/level1.js
https://github.com/NUS-ALSET/games/blob/master/src/squadSinglePlayerGame/src/simulation/level2.js
https://github.com/NUS-ALSET/games/blob/master/src/squadSinglePlayerGame/src/simulation/level3.js
These 3 are the custom codes that user will write and can able to edit according to me so instead of providing fixed code and importing in the main component, provide an option to pass these 3 level code as props so that user can edit them in different code editor and that can be used in this component via props.
The priority is to make the game's mechanics more apparent and clear to the player. It does not have to be pretty :)
Clicking the Bot-vs-Bot table cell should be pointing to a spectator-mode viewing the game as a spectator, currently clicking bot-bot table cell kind of rearranges the table. Do not rearrange the table, instead make it auto-rank by overall score.
Clicking the Bot-vs-User table cell correctly opens a game window, but it is broken currently:
Link to the tournament prototype:
https://0o2788vqw0.codesandbox.io/?gameType=gameTournament
The link at the bottom of documentation for URL params points to a broken page:
https://0o2788vqw0.codesandbox.io/?mode=custom&level=2&gameTime=200&botsQuantities=5&scoreToWin=35&playAsPlayer2=true&&gameType=gameTournament
All the elements have position absolute which makes it difficult to integrate into other designs. Put all the styles into separate CSS file so that they can be overridable to integrate. Below is an example is given for Tournament.js file
Instead of this
<div style={{position:'absolute', zIndex:100, left:'50%', transform:'translate(-50%, 0%)', top:'145px'}}>
Use It as
<div className="tournament__container">
and styles will goes into tournament.css file or style.css
style.css
.tournament__container{
position: absolute;
zIndex:100;
left:50%;
transform:translate(-50%, 0%);
}
this file can be imported into react component directly.
Game components are being rendered directly using React-DOM for codesandbox but we need to make a way to export a component also so that It can be integrated with other apps.
Run Tournament
Custom Code Tournament
Hide Tournament
buttons need to be passed as props to the Tournament component so that they can be controllable and customizable from the parent component.
Example:
RunTournament: True/False
CustomCodeTournament: True/False
HideTournament: True/False
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.