mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-24 05:56:14 -04:00
5 colors /level, sound when ball or brick change color
This commit is contained in:
parent
b6fe46c9bc
commit
2e3ab3011f
21 changed files with 1379 additions and 598 deletions
|
@ -45,7 +45,10 @@ function App() {
|
|||
|
||||
|
||||
|
||||
return <div onMouseUp={() => setApplying('')} onMouseLeave={() => setApplying('')}>
|
||||
return <div onMouseUp={() => {
|
||||
console.log('mouse up')
|
||||
setApplying('')
|
||||
}} >
|
||||
<div id={"levels"}>
|
||||
{
|
||||
levels.map((level, li) => {
|
||||
|
@ -58,9 +61,12 @@ function App() {
|
|||
brickButtons.push(<button
|
||||
key={index}
|
||||
onMouseDown={() => {
|
||||
const color = selected === bricks[index] ? '_' : applying
|
||||
setApplying(color)
|
||||
updateLevel(li, setBrick(level, index, color))
|
||||
if(!applying){
|
||||
console.log(selected, bricks[index],applying)
|
||||
const color = selected === bricks[index] ? '_' : selected
|
||||
setApplying(color)
|
||||
updateLevel(li, setBrick(level, index, color))
|
||||
}
|
||||
}}
|
||||
onMouseEnter={() => {
|
||||
if (applying) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue