fac-17 / leonie-jan-app Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://leonie-jan-tamagotchi.netlify.com/
Home Page: https://leonie-jan-tamagotchi.netlify.com/
The initial create react app code has a bunch of service worker stuff we were meant to remove unless you are actually using it.
I'm 80% sure you aren't using it, but if not I'd like to know what you are doing with it!
Very minor thing.
But if you were usertesting this with me I d say I am confused why the submit button is still there after I have already selected who I want to be. Feel like the button could disappear or the wording of it could change.
:)
Char size
As well as multiple people appearing you could also have levels where on the first level the characters are much smaller in radius so it is easier to avoid them. then they get bigger as you get better.
Points
You could make the character have to traverse the field to reach a goal and score points or finish a level. Or perhaps they could pick up stars.
State Treats
There could be interesting things to try and hit like an invincible treat thing that gives them 10 seconds of being invincible and the other characters don't affect them. Or something that makes all the other characters explode.
The character seems to be quite jumpy and doesn't always move when I hit the button and also moves very slow.
You could give some more acceleration and deceleration components.
So when I hit left once the character moves at one pixel per second left. if i hit twice two pixels and it goes up to a max of say 5 pixels per second.
Then you can also add a deceleration constant that means it slows by one pixel per second every second
(actual values completely stupid so test and make appropriate)
This effect function is pretty long, and actually has two responsibilities: setting up a keydown event listener and starting the interval to increment the score.
Since you can have as many useEffect
calls as you like it's nice to have one per "concern"
Though I don't think it will actually manifest in a bug here - it is best not to use indexes as keys in react. If you get into the habit of doing it, you may end up doing it in a situation where it does cause a bug.
see: https://medium.com/@robinpokorny/index-as-a-key-is-an-anti-pattern-e0349aece318
leonie-jan-app/src/components/PlayingField.js
Lines 25 to 62 in c1722c2
This could be a nice use case for a switch statement.
Also the multiple if
s without else
s when the conditions are mutually exclusive feels a little loose to me - would be nice to be explicit if you do stick with the else/ifs.
When using strings as constants - e.g. with your page state ("LandingPage", "GamePage" etc), a common / nice pattern is to have these defined as variables and then use the variables.
e.g.
// PageConstants.js
export const LandingPage = "LandingPage"
// etc...
This is because, if constantly rewriting strings you can end up with confusing bugs by putting typos of the strings in - "LnadingPage"
would work, and set the state with that string, but you have no page to match it. If you miswrote LnadingPage
, LnadingPage
would be undefined / and undeclared variable and maybe be a bit easier to debug.
Great game Leonie/Jan. Very sleek and professional layout. Brilliant CSS design
The game is super fun!!! Bravo!!! ๐๐๐๐ I can't stop playing hahaha
If you don't change the input name of Laleonie by default, the picture doesn't appear.
When you change name, the field has another default 'Your Name' but I can't anything anymore...
The animateFollower
function contains complex logic - and is kind of a big part of the way the application works.
I would expect to see tests for this kind of thing.
might want to remove those
I know thw focus of the project is react, but it would be nice to have a custom readme with some info about the project rather than just the auto-generated CRA one.
Might want to clean up your files, everything related to:
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.