Skip to content

Commit 0bca12e

Browse files
committed
Fix explosion optimization.
1 parent 7b64231 commit 0bca12e

File tree

1 file changed

+71
-192
lines changed

1 file changed

+71
-192
lines changed

examples/3d-bomberman/3d-bomberman.json

Lines changed: 71 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,16 +3620,6 @@
36203620
"hasNewBombExploded",
36213621
"True"
36223622
]
3623-
},
3624-
{
3625-
"type": {
3626-
"value": "DebuggerTools::ConsoleLog"
3627-
},
3628-
"parameters": [
3629-
"\"------STEP-----\"",
3630-
"",
3631-
""
3632-
]
36333623
}
36343624
]
36353625
},
@@ -3678,6 +3668,15 @@
36783668
}
36793669
],
36803670
"actions": [
3671+
{
3672+
"type": {
3673+
"value": "AjoutObjConcern"
3674+
},
3675+
"parameters": [
3676+
"",
3677+
"Explosion"
3678+
]
3679+
},
36813680
{
36823681
"type": {
36833682
"value": "Bomb::Explode"
@@ -6843,34 +6842,6 @@
68436842
"lastChangeTimeStamp": 0,
68446843
"name": "Check explosion collision",
68456844
"events": [
6846-
{
6847-
"type": "BuiltinCommonInstructions::Standard",
6848-
"conditions": [
6849-
{
6850-
"type": {
6851-
"value": "CollisionNP"
6852-
},
6853-
"parameters": [
6854-
"Explosion",
6855-
"Wall",
6856-
"",
6857-
"",
6858-
""
6859-
]
6860-
}
6861-
],
6862-
"actions": [
6863-
{
6864-
"type": {
6865-
"value": "Delete"
6866-
},
6867-
"parameters": [
6868-
"Explosion",
6869-
""
6870-
]
6871-
}
6872-
]
6873-
},
68746845
{
68756846
"type": "BuiltinCommonInstructions::Standard",
68766847
"conditions": [
@@ -34340,16 +34311,33 @@
3434034311
"conditions": [
3434134312
{
3434234313
"type": {
34343-
"value": "Bomb::IsExplosionAlreadyCreated"
34314+
"value": "Bomb::ExplosionBehavior::HasJustBeenCreated"
3434434315
},
3434534316
"parameters": [
34346-
"",
3434734317
"Explosion",
3434834318
"ExplosionBehavior",
34349-
"Bomb.X() + GetArgumentAsNumber(\"ExplosionDirectionX\") * 60 * Variable(iteration)",
34350-
"Bomb.Y() + GetArgumentAsNumber(\"ExplosionDirectionY\") * 60 * Variable(iteration)",
3435134319
""
3435234320
]
34321+
},
34322+
{
34323+
"type": {
34324+
"value": "PosX"
34325+
},
34326+
"parameters": [
34327+
"Explosion",
34328+
"=",
34329+
"Bomb.X() + GetArgumentAsNumber(\"ExplosionDirectionX\") * 60 * Variable(iteration)"
34330+
]
34331+
},
34332+
{
34333+
"type": {
34334+
"value": "PosY"
34335+
},
34336+
"parameters": [
34337+
"Explosion",
34338+
"=",
34339+
"Bomb.Y() + GetArgumentAsNumber(\"ExplosionDirectionY\") * 60 * Variable(iteration)"
34340+
]
3435334341
}
3435434342
],
3435534343
"actions": [
@@ -34366,17 +34354,7 @@
3436634354
},
3436734355
{
3436834356
"type": "BuiltinCommonInstructions::Standard",
34369-
"conditions": [
34370-
{
34371-
"type": {
34372-
"value": "SceneVariableAsBoolean"
34373-
},
34374-
"parameters": [
34375-
"isExplosionAlreadyCreated",
34376-
"="
34377-
]
34378-
}
34379-
],
34357+
"conditions": [],
3438034358
"actions": [
3438134359
{
3438234360
"type": {
@@ -34390,30 +34368,6 @@
3439034368
"\"\""
3439134369
]
3439234370
},
34393-
{
34394-
"type": {
34395-
"value": "Create"
34396-
},
34397-
"parameters": [
34398-
"",
34399-
"ParticleEmitter",
34400-
"Explosion.CenterX()",
34401-
"Explosion.CenterY()",
34402-
"\"\""
34403-
]
34404-
},
34405-
{
34406-
"type": {
34407-
"value": "Create"
34408-
},
34409-
"parameters": [
34410-
"",
34411-
"ParticleEmitter",
34412-
"Explosion.CenterX() - GetArgumentAsNumber(\"ExplosionDirectionX\") * 30",
34413-
"Explosion.CenterY() - GetArgumentAsNumber(\"ExplosionDirectionY\") * 30",
34414-
"\"\""
34415-
]
34416-
},
3441734371
{
3441834372
"type": {
3441934373
"value": "ModVarObjet"
@@ -34457,6 +34411,46 @@
3445734411
}
3445834412
],
3445934413
"events": [
34414+
{
34415+
"type": "BuiltinCommonInstructions::Standard",
34416+
"conditions": [
34417+
{
34418+
"type": {
34419+
"value": "SceneVariableAsBoolean"
34420+
},
34421+
"parameters": [
34422+
"isExplosionAlreadyCreated",
34423+
"="
34424+
]
34425+
}
34426+
],
34427+
"actions": [
34428+
{
34429+
"type": {
34430+
"value": "Create"
34431+
},
34432+
"parameters": [
34433+
"",
34434+
"ParticleEmitter",
34435+
"Explosion.CenterX()",
34436+
"Explosion.CenterY()",
34437+
"\"\""
34438+
]
34439+
},
34440+
{
34441+
"type": {
34442+
"value": "Create"
34443+
},
34444+
"parameters": [
34445+
"",
34446+
"ParticleEmitter",
34447+
"Explosion.CenterX() - GetArgumentAsNumber(\"ExplosionDirectionX\") * 30",
34448+
"Explosion.CenterY() - GetArgumentAsNumber(\"ExplosionDirectionY\") * 30",
34449+
"\"\""
34450+
]
34451+
}
34452+
]
34453+
},
3446034454
{
3446134455
"type": "BuiltinCommonInstructions::Comment",
3446234456
"color": {
@@ -34567,111 +34561,6 @@
3456734561
}
3456834562
],
3456934563
"objectGroups": []
34570-
},
34571-
{
34572-
"fullName": "Explosion already created",
34573-
"functionType": "Condition",
34574-
"name": "IsExplosionAlreadyCreated",
34575-
"private": true,
34576-
"sentence": "_PARAM1_ already created at _PARAM3_ ; _PARAM4_",
34577-
"events": [
34578-
{
34579-
"type": "BuiltinCommonInstructions::Standard",
34580-
"conditions": [
34581-
{
34582-
"type": {
34583-
"value": "Bomb::ExplosionBehavior::HasJustBeenCreated"
34584-
},
34585-
"parameters": [
34586-
"Explosion",
34587-
"ExplosionBehavior",
34588-
""
34589-
]
34590-
},
34591-
{
34592-
"type": {
34593-
"value": "PosX"
34594-
},
34595-
"parameters": [
34596-
"Explosion",
34597-
"=",
34598-
"GetArgumentAsNumber(\"PositionX\")"
34599-
]
34600-
},
34601-
{
34602-
"type": {
34603-
"value": "PosY"
34604-
},
34605-
"parameters": [
34606-
"Explosion",
34607-
"=",
34608-
"GetArgumentAsNumber(\"PositionY\")"
34609-
]
34610-
}
34611-
],
34612-
"actions": [
34613-
{
34614-
"type": {
34615-
"value": "SetReturnBoolean"
34616-
},
34617-
"parameters": [
34618-
"True"
34619-
]
34620-
},
34621-
{
34622-
"type": {
34623-
"value": "DebuggerTools::ConsoleLog"
34624-
},
34625-
"parameters": [
34626-
"\"Exists at: \" + GetArgumentAsString(\"PositionX\") + \" \" + GetArgumentAsString(\"PositionY\")",
34627-
"",
34628-
""
34629-
]
34630-
}
34631-
]
34632-
},
34633-
{
34634-
"type": "BuiltinCommonInstructions::ForEach",
34635-
"object": "Explosion",
34636-
"conditions": [],
34637-
"actions": [
34638-
{
34639-
"type": {
34640-
"value": "DebuggerTools::ConsoleLog"
34641-
},
34642-
"parameters": [
34643-
"GetArgumentAsString(\"PositionX\") + \" \" + GetArgumentAsString(\"PositionY\") + \" = \" + ToString(Explosion.X()) + \" \" + ToString(Explosion.Y())",
34644-
"",
34645-
""
34646-
]
34647-
}
34648-
]
34649-
}
34650-
],
34651-
"parameters": [
34652-
{
34653-
"description": "Explosion",
34654-
"name": "Explosion",
34655-
"type": "objectList"
34656-
},
34657-
{
34658-
"description": "Explosion",
34659-
"name": "ExplosionBehavior",
34660-
"supplementaryInformation": "Bomb::ExplosionBehavior",
34661-
"type": "behavior"
34662-
},
34663-
{
34664-
"description": "Position on X axis",
34665-
"name": "PositionX",
34666-
"type": "expression"
34667-
},
34668-
{
34669-
"description": "Position on Y axis",
34670-
"name": "PositionY",
34671-
"type": "expression"
34672-
}
34673-
],
34674-
"objectGroups": []
3467534564
}
3467634565
],
3467734566
"eventsBasedBehaviors": [
@@ -35070,16 +34959,6 @@
3507034959
"parameters": [
3507134960
"True"
3507234961
]
35073-
},
35074-
{
35075-
"type": {
35076-
"value": "DebuggerTools::ConsoleLog"
35077-
},
35078-
"parameters": [
35079-
"\"Just created\"",
35080-
"",
35081-
""
35082-
]
3508334962
}
3508434963
]
3508534964
}

0 commit comments

Comments
 (0)