File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " github-breakout" ,
3- "version" : " 1.1.0 " ,
3+ "version" : " 1.1.1 " ,
44 "main" : " index.js" ,
55 "license" : " MIT" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " GitHub Breakout" ,
3- "version" : " 1.1.0 " ,
3+ "version" : " 1.1.1 " ,
44 "manifest_version" : 2 ,
55 "description" : " Breakout!" ,
66 "permissions" : [" storage" ],
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export class Block implements GameObject, Rect {
1010 bottom : number
1111
1212 origianlLife : number
13- originalColor : string
13+ originalColorLevel : string
1414
1515 life : number
1616
@@ -27,8 +27,7 @@ export class Block implements GameObject, Rect {
2727
2828 this . origianlLife = Number ( el . getAttribute ( 'data-count' ) )
2929 this . life = this . origianlLife
30- this . originalColor =
31- el . getAttribute ( 'fill' ) || 'var(--color-calendar-graph-day-bg)'
30+ this . originalColorLevel = el . getAttribute ( 'data-level' ) || '0'
3231 }
3332
3433 update ( delta : number ) { }
@@ -40,11 +39,12 @@ export class Block implements GameObject, Rect {
4039 this . life = 0 // breaks at once
4140 this . blockElement . setAttribute ( 'fill' , 'var(--color-calendar-graph-day-bg)' )
4241 this . blockElement . setAttribute ( 'data-count' , '0' )
42+ this . blockElement . setAttribute ( 'data-level' , '0' )
4343 }
4444
4545 reset ( ) {
4646 this . life = this . origianlLife
47- this . blockElement . setAttribute ( 'fill ' , this . originalColor )
47+ this . blockElement . setAttribute ( 'data-level ' , this . originalColorLevel )
4848 this . blockElement . setAttribute ( 'data-count' , this . origianlLife . toString ( ) )
4949 }
5050}
You can’t perform that action at this time.
0 commit comments