good-meowning's People
good-meowning's Issues
Project 0 Feedback
Project Strengths
- So creative!! The cat theme really makes this project stand out.
๐ธ - Strong UX and UI that supports the theme and makes the game fun to play!
- Your code is well-indented, well-commented, logical, and easy to follow.
๐ - Great use of functions to keep your code DRY. I'm especially impressed with the
handleTimer()
helper function you used for the countdown. - Excellent logic around successive keypresses, and I like that it makes the game more challenging to play.
Growth Opportunities
-
CSS Organization:
- It looks like there are CSS files you're not using (
specimen_files
). Remove any files you don't end up using so other developers don't waste time figuring out what they're being used for. (There's also astylesheet.css.zip
that you can remove as well.) - Remember to always require your custom stylesheet AFTER you require Bootstrap in case you want to override any of Bootstrap's default styles. It doesn't look like it's affecting your styles here, but it's best practice to move your stylesheet after Bootstrap just in case.
- Make a separate folder inside
CSS
calledfonts
to hold your custom fonts. - Define your
@font-face
at the top of your stylesheet instead of at the bottom.
- It looks like there are CSS files you're not using (
-
Folder Names: It's best practice to name your folders in lowercase. Change
CSS
tocss
andIMGs
toimages
. -
Tab Spacing: Consistent tab-spacing in all your files helps readability. You're using 2 spaces in
index.html
andmain.js
and 4 spaces instylesheet.css
. The standard is 2 spaces, so updatestylesheet.css
to match your other files. -
GitHub Commits: For your next project, try more frequent and descriptive commit messages. Looking at your first commit, you could've split out CSS into a commit of its own, then broken down the "game functionality started" into several commits (3-4), each one describing which part of the game functionality was implemented.
-
Global Variables: Nice job recognizing you need to refactor your global variables! Try representing your players as objects:
var player1 = { countA: 0, countS: 0, countD: 0, countF: 0 }
This turns 8 global variables into 2. You can also store page elements related to your players on this object, which prevents selecting elements more than once (bad for memory):
var player1 = { countA: 0, countS: 0, countD: 0, countF: 0, gameBox: $('#gb1'), cat: $('#p1') }
-
Refactor Vanilla JS: I see why you're using Vanilla JS to use the
.src()
method. Since you're using jQuery in other parts of your app though, it's best to keep it consistent. Try somthing like$('#p1').attr('src', 'IMGs/sleepyCat2.gif')
, or evenplayer1.cat.attr('src', 'IMGs/sleepyCat2.gif')
!! -
Player Functionality: Player 1 and Player 2 have essentially the same functionality, so there are a couple places where it makes sense to use functions to DRY this up. Example: These lines are repeated for Player 1 and Player 2, so you could have a function
wakeUpCat(player)
that takes care of checking the keypress counts and changing the cat gif.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.