Commit b4e931f4 authored by wangxin's avatar wangxin

效果

parent 4dcbae00
{
"__type__": "cc.AnimationClip",
"_name": "wrong",
"_objFlags": 0,
"_native": "",
"_duration": 6,
"sample": 60,
"speed": 4,
"wrapMode": 1,
"curveData": {
"props": {
"position": [
{
"frame": 0,
"value": [
0,
0,
0
]
},
{
"frame": 0.5,
"value": [
-10,
0,
0
]
},
{
"frame": 1,
"value": [
0,
0,
0
]
},
{
"frame": 1.5,
"value": [
10,
0,
0
]
},
{
"frame": 2,
"value": [
0,
0,
0
]
},
{
"frame": 2.5,
"value": [
-10,
0,
0
]
},
{
"frame": 3,
"value": [
0,
0,
0
]
},
{
"frame": 3.5,
"value": [
10,
0,
0
]
},
{
"frame": 4,
"value": [
0,
0,
0
]
},
{
"frame": 4.5,
"value": [
-10,
0,
0
]
},
{
"frame": 5,
"value": [
0,
0,
0
]
},
{
"frame": 5.5,
"value": [
10,
0,
0
]
},
{
"frame": 6,
"value": [
0,
0,
0
]
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "b2ca5c8c-5d35-44c7-948b-810789a2bccd",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "f074d2b6-91fb-457f-bc83-93ffa39a7ca3",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>angle</key>
<real>17</real>
<key>angleVariance</key>
<real>180</real>
<key>blendFuncDestination</key>
<integer>1</integer>
<key>blendFuncSource</key>
<integer>768</integer>
<key>duration</key>
<real>0.22</real>
<key>emitterType</key>
<real>0</real>
<key>finishColorAlpha</key>
<real>1</real>
<key>finishColorBlue</key>
<real>0</real>
<key>finishColorGreen</key>
<real>0</real>
<key>finishColorRed</key>
<real>0</real>
<key>finishColorVarianceAlpha</key>
<real>0</real>
<key>finishColorVarianceBlue</key>
<real>0</real>
<key>finishColorVarianceGreen</key>
<real>0</real>
<key>finishColorVarianceRed</key>
<real>0</real>
<key>finishParticleSize</key>
<real>-1</real>
<key>finishParticleSizeVariance</key>
<real>0</real>
<key>gravityx</key>
<real>-20</real>
<key>gravityy</key>
<real>420</real>
<key>maxParticles</key>
<real>191</real>
<key>maxRadius</key>
<real>0</real>
<key>maxRadiusVariance</key>
<real>0</real>
<key>minRadius</key>
<real>0</real>
<key>particleLifespan</key>
<real>0.47</real>
<key>particleLifespanVariance</key>
<real>0</real>
<key>radialAccelVariance</key>
<real>0</real>
<key>radialAcceleration</key>
<real>0</real>
<key>rotatePerSecond</key>
<real>0</real>
<key>rotatePerSecondVariance</key>
<real>0</real>
<key>rotationEnd</key>
<real>0</real>
<key>rotationEndVariance</key>
<real>0.0</real>
<key>rotationStart</key>
<real>0</real>
<key>rotationStartVariance</key>
<real>0</real>
<key>sourcePositionVariancex</key>
<real>0</real>
<key>sourcePositionVariancey</key>
<real>0</real>
<key>sourcePositionx</key>
<real>416</real>
<key>sourcePositiony</key>
<real>774</real>
<key>speed</key>
<real>480</real>
<key>speedVariance</key>
<real>20</real>
<key>startColorAlpha</key>
<real>0.89</real>
<key>startColorBlue</key>
<real>0.2</real>
<key>startColorGreen</key>
<real>0.4</real>
<key>startColorRed</key>
<real>1</real>
<key>startColorVarianceAlpha</key>
<real>0</real>
<key>startColorVarianceBlue</key>
<real>0</real>
<key>startColorVarianceGreen</key>
<real>0</real>
<key>startColorVarianceRed</key>
<real>0</real>
<key>startParticleSize</key>
<real>20</real>
<key>startParticleSizeVariance</key>
<real>41</real>
<key>tangentialAccelVariance</key>
<real>0</real>
<key>tangentialAcceleration</key>
<real>-700</real>
<key>textureFileName</key>
<string>particle_star.png</string>
<key>textureImageData</key>
<string></string>
</dict>
</plist>
{
"ver": "2.0.1",
"uuid": "986c8cea-3186-454a-865b-c818da543819",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3a8508c6-3d78-4768-b77e-9d6b00a918b0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 37,
"height": 36,
"platformSettings": {},
"subMetas": {
"particle_star": {
"ver": "1.0.4",
"uuid": "539cc31f-1963-46f3-9f0f-fb8f5658c54e",
"rawTextureUuid": "3a8508c6-3d78-4768-b77e-9d6b00a918b0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 37,
"height": 36,
"rawWidth": 37,
"rawHeight": 36,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -31,10 +31,13 @@ ...@@ -31,10 +31,13 @@
}, },
{ {
"__id__": 7 "__id__": 7
},
{
"__id__": 8
} }
], ],
"_prefab": { "_prefab": {
"__id__": 8 "__id__": 9
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -254,7 +257,39 @@ ...@@ -254,7 +257,39 @@
"pic": { "pic": {
"__id__": 3 "__id__": 3
}, },
"particle_star": {
"__uuid__": "de39730a-d6dc-4031-9744-9ca5c01fc1f0"
},
"sounds": [
{
"__uuid__": "5060d073-9761-4a5c-8910-5439b56725bf"
},
{
"__uuid__": "c271a59a-d4e5-453e-8e2e-5b97fa3e4b43"
}
],
"_opId": 0, "_opId": 0,
"_ori_pos": null,
"_isEnter": false,
"_isContact": false,
"_soundOp": null,
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": null,
"_clips": [
{
"__uuid__": "b2ca5c8c-5d35-44c7-948b-810789a2bccd"
}
],
"playOnLoad": false,
"_id": "" "_id": ""
}, },
{ {
......
...@@ -482,6 +482,9 @@ ...@@ -482,6 +482,9 @@
"iconSound": { "iconSound": {
"__id__": 3 "__id__": 3
}, },
"particle": {
"__uuid__": "de39730a-d6dc-4031-9744-9ca5c01fc1f0"
},
"_opId": 0, "_opId": 0,
"_soundUrl": "", "_soundUrl": "",
"_id": "" "_id": ""
......
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "particle_star",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.ParticleSystem",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_custom": true,
"_file": {
"__uuid__": "986c8cea-3186-454a-865b-c818da543819"
},
"_spriteFrame": {
"__uuid__": "539cc31f-1963-46f3-9f0f-fb8f5658c54e"
},
"_texture": null,
"_stopped": true,
"playOnLoad": true,
"autoRemoveOnFinish": true,
"totalParticles": 191,
"duration": 0.22,
"emissionRate": 200,
"life": 0.47,
"lifeVar": 0.6,
"_startColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_startColorVar": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_endColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_endColorVar": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"angle": -180,
"angleVar": 180,
"startSize": 10,
"startSizeVar": 30,
"endSize": -1,
"endSizeVar": 0,
"startSpin": 0,
"startSpinVar": 180,
"endSpin": 0,
"endSpinVar": 180,
"sourcePos": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"posVar": {
"__type__": "cc.Vec2",
"x": 100,
"y": 100
},
"_positionType": 1,
"positionType": 1,
"emitterMode": 0,
"gravity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 120
},
"speed": 20,
"speedVar": 220,
"tangentialAccel": 0,
"tangentialAccelVar": 0,
"radialAccel": 0,
"radialAccelVar": 0,
"rotationIsDir": false,
"startRadius": 0,
"startRadiusVar": 0,
"endRadius": 0,
"endRadiusVar": 0,
"rotatePerS": 0,
"rotatePerSVar": 0,
"_N$preview": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b6qTzZ+GtJjpvXdRXuot9u",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "de39730a-d6dc-4031-9744-9ca5c01fc1f0",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
"array": [ "array": [
0, 0,
0, 0,
310.0292431292173, 310.037094554829,
0, 0,
0, 0,
0, 0,
...@@ -1334,7 +1334,7 @@ ...@@ -1334,7 +1334,7 @@
"node": { "node": {
"__id__": 26 "__id__": 26
}, },
"_enabled": false, "_enabled": true,
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 552, "width": 552,
...@@ -1430,12 +1430,6 @@ ...@@ -1430,12 +1430,6 @@
{ {
"__uuid__": "684d7cb6-2589-4ca9-97e4-4fee3d611cdc" "__uuid__": "684d7cb6-2589-4ca9-97e4-4fee3d611cdc"
}, },
{
"__uuid__": "5060d073-9761-4a5c-8910-5439b56725bf"
},
{
"__uuid__": "c271a59a-d4e5-453e-8e2e-5b97fa3e4b43"
},
{ {
"__uuid__": "f7ba93b1-0719-40f3-8482-0d5d94a2fb8f" "__uuid__": "f7ba93b1-0719-40f3-8482-0d5d94a2fb8f"
} }
......
...@@ -36,7 +36,7 @@ cc.Class({ ...@@ -36,7 +36,7 @@ cc.Class({
type: cc.Prefab, type: cc.Prefab,
}, },
// 声音,0-进入,1-正确,2-错误,3-结束 // 声音,0-进入,1-结束
sounds: { sounds: {
default: [], default: [],
type: [cc.AudioClip], type: [cc.AudioClip],
......
...@@ -12,6 +12,18 @@ cc.Class({ ...@@ -12,6 +12,18 @@ cc.Class({
type: cc.Sprite, type: cc.Sprite,
}, },
// 星星特效
particle_star: {
default: null,
type: cc.Prefab,
},
// 声音,0-正确,1-错误
sounds: {
default: [],
type: [cc.AudioClip],
},
_opId: 0, // 选项id _opId: 0, // 选项id
_ori_pos: null, // 初始位置 _ori_pos: null, // 初始位置
_isEnter: false, // 是否碰到对的选框 _isEnter: false, // 是否碰到对的选框
...@@ -72,11 +84,19 @@ cc.Class({ ...@@ -72,11 +84,19 @@ cc.Class({
onTouchEnd() { onTouchEnd() {
this.nodePos = this.node.getPosition(); //获取触摸结束之后的node坐标; this.nodePos = this.node.getPosition(); //获取触摸结束之后的node坐标;
if (this._isContact) { if (this._isContact) {
this.node.setPosition(); this.node.position = this._soundOp.position;
if (this._isEnter) { if (this._isEnter) {
console.log("enter right"); console.log("enter right");
this.playSound(0);
var par = cc.instantiate(this.particle_star);
this.node.addChild(par);
} else { } else {
console.log("enter false"); console.log("enter false");
this.playSound(1);
this.node.getComponent(cc.Animation).play("wrong");
this.scheduleOnce(function () {
this.node.setPosition(this._ori_pos);
}, 2);
} }
} else { } else {
this.node.setPosition(this._ori_pos); this.node.setPosition(this._ori_pos);
...@@ -108,4 +128,9 @@ cc.Class({ ...@@ -108,4 +128,9 @@ cc.Class({
this._isContact = false; this._isContact = false;
this._soundOp = null; this._soundOp = null;
}, },
// 播放声音
playSound(index) {
cc.audioEngine.playEffect(this.sounds[index], false);
},
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment