-
Notifications
You must be signed in to change notification settings - Fork 233
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
Pull request #8
base: master
Are you sure you want to change the base?
Pull request #8
Conversation
Block now rotates in standardized way. The number of shapes now increases to 28.
Change audio format into mp3 becuase to fix issue 18-1-SKKU-OSS/canvas-tetris#11. Read sound file for each trigger (tetris.js) to emit multiple sound at the same time.
Resolve 18-1-SKKU-OSS/canvas-tetris#14
Expand the canvas are to draw next moving block and also make 'game over' function applied to expanded area.
Resolve 18-1-SKKU-OSS/canvas-tetris#13
The shadow of dropped position is shown to the user. Resolve 18-1-SKKU-OSS/canvas-tetris#5.
A shape now occur just once per one cycle, following tetris standard.
Block ghost effect was also added. |
<natures> | ||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> | ||
</natures> | ||
</projectDescription> |
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.
Please remove eclipse project files!
@@ -0,0 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
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.
remove this file
@@ -0,0 +1 @@ | |||
org.eclipse.wst.jsdt.launching.JRE_CONTAINER |
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.
remove this file
@@ -0,0 +1 @@ | |||
Global |
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.
remove this file
0, 1, 0, 0, | ||
0, 1, 0, 0, | ||
0, 1 ], | ||
[ 1, 1, 1, 1 ], |
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.
Instead of repeating the shapes like this, perhaps generate a shape randomly and then rotate it at random. The way you have it now is too repeatitive.
}; | ||
if ( typeof keys[ e.keyCode ] != 'undefined' ) { | ||
if ( typeof keys[ e.keyCode ] != 'undefined' && !lose) { |
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.
Follow the coding style from the rest of the project
@@ -11,26 +11,172 @@ function drawBlock( x, y ) { | |||
|
|||
// draws the board and the moving shape | |||
function render() { | |||
ctx.clearRect( 0, 0, W, H ); | |||
if ( pause == false ) { |
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.
!pause
|
||
function gameOver() { | ||
ctx.clearRect( 0, 0, 440, 600 ); | ||
clearInterval( setcolor ); |
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.
Please indent your code correctly
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.
We are trying to clean up overall source codes to keep your convention. Sorry for the mistake.
} | ||
if ( next3[ y ][ x ] ) { | ||
ctx.fillStyle = colors[ next3[ y ][ x ] - 1 ]; | ||
drawBlock( 10.5 + x, 9.5 + y ); |
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.
Separate constants into beginning of file, make them semantic
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.
We feel very grateful for your feedback. Since we are in final-exam week, we will give you immediate revision after about one or two weeks. Thank you very much!
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.
Please check our final resort to see what's going on! We are planning to clean up, simplify, and also optimize much more for better code.
You can see other solved issues here:
https://github.com/18-1-SKKU-OSS/canvas-tetris/issues?q=is%3Aissue+is%3Aclosed