-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature fun #2
base: development
Are you sure you want to change the base?
Feature fun #2
Conversation
create new RoundBall class node and add radius propertie
Remove the square ball and increase speed of players paddle
Add Net Node Class, create textsize varibles for main and second
Add Sound class and implement Game Music
Add bounce and point-score sound effects
Add background, remove body margin and adjust some of objects colors
When players hit the ball their speed also increase
@@ -90,11 +100,13 @@ app.onUpdate = function(time){ | |||
|
|||
app.pause = function(){ | |||
if(state == 'GAME'){ | |||
music.pause() // Pause Game Music |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
music.pause()
isn't descriptive enough so you added // Pause Game Music
to make sure the code reader understands right? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, yes I define the "music" object and added some comments when I invoke the methods
} | ||
|
||
if(keyName == ' '){ | ||
if(state == 'GAME' || state == 'PAUSE') | ||
if(state == 'GAME' || state == 'PAUSE'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a typo and the game breaks
maybe you shouldn't use strings huh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how to use enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, I haven´t use enum before but I can change it and not use strings
public/js/modules/module.js
Outdated
@@ -3,17 +3,17 @@ | |||
class Player { | |||
constructor(id,app,color,playerNum) { | |||
this.initialY = app.height/2 | |||
this.speed = 8 | |||
this.speed = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ever heard of magic numbers?
You're a true magician putting magic all over the code :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You´re right, I should create some constants for those values to be easy to track.
|
Hi, I don´t have a linkedin account but I can tell you about myself.
Languages
´I have always adapted to the language that is require, is true that I´m missing on some of the good practices on coding and to be really honest this is the first time somene review my code, I´ve always reviewed someone else apps functionality and make some code adjustment because of the deadlines to the clients´ |
Introduction
In this update it has been created a more like Game enviroment to make it fun 🥇
Features
VideoDemo
Demo.mp4