Durdles - 2-Player Action Game
import QtQuick 2.0
import Felgo 4.0
import "../.."
EntityBase {
id: powPowershot
entityType: "powPowershot"
width: 25
height: 25
onEntityCreated: GameInfo.powerUpCount+=1
AnimatedImage {
id: powPowershotImage
width: parent.width
height: parent.height
source: Qt.resolvedUrl("../../../assets/img/PUPowershot.gif")
anchors.centerIn: parent
playing: true
}
BoxCollider {
id: boxCollider
anchors.fill: powPowershotImage
anchors.centerIn: parent
sensor:true
fixture.onBeginContact: (other, contactNormal) => {
var collidedEntity = other.getBody().target;
if (collidedEntity.isOfType("tankRed")){
collidedEntity.plingSound.play();
collidedEntity.parent.activatePowershot = true
collidedEntity.parent.activePowershotCounter = 0
powPowershot.destroy()
GameInfo.powerUpCount -= 1
} else if (collidedEntity.isOfType("tankBlue")){
collidedEntity.plingSound.play();
collidedEntity.parent.activatePowershot = true
collidedEntity.parent.activePowershotCounter = 0
powPowershot.destroy()
GameInfo.powerUpCount -= 1
}