Skip to content

Commit 228286f

Browse files
GianlucaGianluca
authored andcommitted
Minor modifications 2
1 parent d2c4569 commit 228286f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/components/controls/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default class Controls extends PureComponent {
1212
this.cannonXPosition = this.props.width / 2
1313
this.translateY = new Animated.Value(0)
1414
this.opacity = new Animated.Value(1)
15+
this.coolDown = false
1516
}
1617

1718
componentDidMount() {
@@ -33,6 +34,7 @@ export default class Controls extends PureComponent {
3334

3435
componentDidUpdate(prevProps, prevState) {
3536
if (this.props.lives > 0 && prevProps.lives !== this.props.lives) {
37+
// Effetto lampeggiante quando il cannone viene colpito
3638
Animated.sequence([
3739
Animated.timing(this.opacity, {
3840
toValue: 0.2,
@@ -53,13 +55,12 @@ export default class Controls extends PureComponent {
5355
fire = () => {
5456
const { fire } = this.props
5557

56-
// Passa a fire() la posizione del cannone, per sincronizzare il proiettile
58+
// Prima della scadenza del periodo di cool down non si può sparare
5759
if (!this.coolDown) {
5860
fire({ x: this.cannonXPosition, y: options.cannonSize })
5961
this.coolDown = true
6062
setTimeout(() => this.coolDown = false, options.rocketCoolDown)
6163
}
62-
6364
}
6465

6566
calculateCannonPosition(offset) {
@@ -115,7 +116,7 @@ const styles = StyleSheet.create({
115116
justifyContent: 'center'
116117
},
117118
flashView: {
118-
// Senza background, su Android non fa l'animazione alla prima chiamata a CDU (!?)
119+
// Senza background su Android non fa l'animazione alla prima chiamata a cDU (!?)
119120
backgroundColor: 'rgba(0,0,0,0)'
120121
}
121122
})

src/components/rocket/player-rocket.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import options from '../../config'
44

55
const offset = {
66
bottom: options.alienSize - (options.alienSize * 0.8),
7-
top: options.alienSize * 0.8,
8-
left: 0,
9-
right: 0
7+
top: options.alienSize * 0.8
108
}
119

1210
export default class PlayerRocket extends PureComponent {

0 commit comments

Comments
 (0)