mirror of
https://github.com/tiennm99/nntv.git
synced 2026-10-14 06:17:54 +00:00
[Init] project with some particles
This commit is contained in:
1 parent
72af9c1794
commit
b04e22948d
20 files changed
+1567
No files matched your search
@@ -0,0 +1,2 @@
|
||||
[InternetShortcut]
|
||||
URL=https://docs.cocos.com/creator/manual/en/scripting/setup.html#custom-script-template
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"image": {
|
||||
"type": "sprite-frame"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
#///////////////////////////
|
||||
# Cocos Creator 3D Project
|
||||
#///////////////////////////
|
||||
library/
|
||||
temp/
|
||||
local/
|
||||
# build/
|
||||
profiles/
|
||||
native
|
||||
#//////////////////////////
|
||||
# NPM
|
||||
#//////////////////////////
|
||||
node_modules/
|
||||
|
||||
#//////////////////////////
|
||||
# VSCode
|
||||
#//////////////////////////
|
||||
.vscode/
|
||||
|
||||
#//////////////////////////
|
||||
# WebStorm
|
||||
#//////////////////////////
|
||||
.idea/
|
||||
@@ -1,2 +1,4 @@
|
||||
# hurt
|
||||
Theo trend phim Thắp sáng anh, sưởi ấm em. Nhưng mà nó hơi lạ :v
|
||||
|
||||
Project được tạo với [Cocos Creator](https://www.cocos.com/en/creator) v3.6
|
||||
@@ -0,0 +1,20 @@
|
||||
import {_decorator, Component, Node, Tween, tween, Vec3} from 'cc';
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('BasePartical')
|
||||
export class BasePartical extends Component {
|
||||
time: number = 0;
|
||||
|
||||
start() {
|
||||
}
|
||||
|
||||
calcPosAt(time: number): Vec3 {
|
||||
return new Vec3(0, 0, 0);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
this.time += deltaTime;
|
||||
this.node.position = this.calcPosAt(this.time);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "a78fab70-8c68-4a3e-8119-7265beb7555b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import {_decorator, Component, Node, Tween, tween, Vec3} from 'cc';
|
||||
import {BasePartical} from "db://assets/BasePartical";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('Heart')
|
||||
export class Heart extends BasePartical {
|
||||
size: number = 12;
|
||||
speed: number = 12;
|
||||
|
||||
start() {
|
||||
console.log("Không biết lập trình web, chỉ biết lập trình game")
|
||||
console.log("Không thể yêu ai khác, bởi đã trót yêu em");
|
||||
console.log("T <3 V");
|
||||
console.log("Source: https://github.com/tiennm99/hurt/");
|
||||
}
|
||||
|
||||
calcPosAt(time: number): Vec3 {
|
||||
let t = time * this.speed;
|
||||
let x = 16 * Math.pow(Math.sin(t), 3);
|
||||
let y = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t);
|
||||
return new Vec3(x * this.size, y * this.size, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "ae2d8892-935f-4cbb-8a90-c0be643ada9c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import {_decorator, Component, Node, Tween, tween, Vec3} from 'cc';
|
||||
import {BasePartical} from "db://assets/BasePartical";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('Split')
|
||||
export class Split extends BasePartical {
|
||||
size: number = 70;
|
||||
speed: number = 6;
|
||||
|
||||
deltaX: number = 0;
|
||||
deltaY: number = -30;
|
||||
|
||||
calcPosAt(time: number): Vec3 {
|
||||
let t = time * this.speed;
|
||||
let a = t % 5;
|
||||
let x, y;
|
||||
if (a < 1) {
|
||||
x = -a / 2;
|
||||
y = 2 - a;
|
||||
} else if (a < 2) {
|
||||
a -= 1;
|
||||
x = -1 / 2 + a;
|
||||
y = 1;
|
||||
} else if (a < 3) {
|
||||
a -= 2;
|
||||
x = 1 / 2 - a;
|
||||
y = 1 - 2 * a;
|
||||
} else if (a < 4) {
|
||||
a -= 3;
|
||||
x = -1 / 2 + a;
|
||||
y = -1;
|
||||
} else {
|
||||
a -= 4;
|
||||
x = (1 - a) / 2;
|
||||
y = -1 - a;
|
||||
}
|
||||
return new Vec3(x * this.size + this.deltaX, y * this.size + this.deltaY, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "ad47dd02-5568-4925-b11d-56173fe5b2a3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import {_decorator, Component, Node, Tween, tween, Vec3} from 'cc';
|
||||
import {BasePartical} from "db://assets/BasePartical";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('T')
|
||||
export class T extends BasePartical {
|
||||
size: number = 100;
|
||||
speed: number = 12;
|
||||
horizontalWeight: number = 1; //Tỉ lệ chiều ngang chữ T
|
||||
verticalWeight: number = 1; //Tỉ lệ chiều dọc chữ T
|
||||
verticalOrigin: number = 1; //Mốc thanh ngang T
|
||||
deltaX: number = -100;
|
||||
deltaY: number = -10;
|
||||
|
||||
calcPosAt(time: number): Vec3 {
|
||||
let t = time * this.speed;
|
||||
let a = t % (this.horizontalWeight + this.verticalWeight);
|
||||
let isStep1 = a < this.horizontalWeight;
|
||||
let x, y;
|
||||
if (isStep1) {
|
||||
x = a - this.horizontalWeight / 2;
|
||||
y = this.verticalOrigin;
|
||||
} else {
|
||||
x = 0;
|
||||
y = this.verticalOrigin - (a - this.horizontalWeight);
|
||||
}
|
||||
return new Vec3(x * this.size + this.deltaX, y * this.size + this.deltaY, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3e0d2b9f-fd3c-48a4-a25e-161139408c6b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import {_decorator, Component, Node, Tween, tween, Vec3} from 'cc';
|
||||
import {BasePartical} from "db://assets/BasePartical";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('V')
|
||||
export class V extends BasePartical {
|
||||
size: number = 60;
|
||||
speed: number = 12;
|
||||
alphaInDegree: number = 60; //Góc chữ V
|
||||
|
||||
alpha = this.alphaInDegree / 2 * Math.PI / 180; //Góc ở radian
|
||||
deltaX: number = 100;
|
||||
deltaY: number = -10;
|
||||
|
||||
calcPosAt(time: number): Vec3 {
|
||||
let t = time * this.speed;
|
||||
let a = t % 2;
|
||||
let x = Math.abs(a - 1);
|
||||
let y = x / Math.tan(this.alpha);
|
||||
if (a < 1) x *= -1;
|
||||
return new Vec3(x * this.size + this.deltaX, y * this.size + this.deltaY, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6eb3308e-e75c-40e0-b514-b763e184eff3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.1.40",
|
||||
"importer": "scene",
|
||||
"imported": true,
|
||||
"uuid": "449b714b-b3bf-4fdc-9316-f7125cd8b382",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "Hurt",
|
||||
"uuid": "06f358b4-7804-4fc7-827b-a4c616247b5d",
|
||||
"version": "3.6.2",
|
||||
"creator": {
|
||||
"version": "3.6.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"game": {
|
||||
"app_id": "680120552",
|
||||
"name": "hurt",
|
||||
"c_id": "0"
|
||||
},
|
||||
"appConfigMaps": [
|
||||
{
|
||||
"app_id": "UNKNOW",
|
||||
"config_id": "078573"
|
||||
},
|
||||
{
|
||||
"app_id": "680120552",
|
||||
"config_id": "80408b"
|
||||
}
|
||||
],
|
||||
"configs": [
|
||||
{
|
||||
"app_id": "UNKNOW",
|
||||
"config_id": "078573",
|
||||
"config_name": "Default",
|
||||
"config_remarks": "",
|
||||
"services": []
|
||||
},
|
||||
{
|
||||
"app_id": "680120552",
|
||||
"config_id": "80408b",
|
||||
"config_name": "Default",
|
||||
"config_remarks": "",
|
||||
"services": [
|
||||
{
|
||||
"service_id": "235",
|
||||
"enable": true,
|
||||
"param": {
|
||||
"app_id": "680120552",
|
||||
"store_id": "H5"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"__version__": "1.0.7",
|
||||
"modules": {
|
||||
"cache": {
|
||||
"base": {
|
||||
"_value": true
|
||||
},
|
||||
"graphcis": {
|
||||
"_value": true
|
||||
},
|
||||
"gfx-webgl": {
|
||||
"_value": true
|
||||
},
|
||||
"gfx-webgl2": {
|
||||
"_value": true
|
||||
},
|
||||
"animation": {
|
||||
"_value": true
|
||||
},
|
||||
"skeletal-animation": {
|
||||
"_value": false
|
||||
},
|
||||
"3d": {
|
||||
"_value": false
|
||||
},
|
||||
"2d": {
|
||||
"_value": true
|
||||
},
|
||||
"xr": {
|
||||
"_value": false
|
||||
},
|
||||
"ui": {
|
||||
"_value": true
|
||||
},
|
||||
"particle": {
|
||||
"_value": false
|
||||
},
|
||||
"physics": {
|
||||
"_value": false,
|
||||
"_option": "physics-ammo"
|
||||
},
|
||||
"physics-ammo": {
|
||||
"_value": false
|
||||
},
|
||||
"physics-cannon": {
|
||||
"_value": false
|
||||
},
|
||||
"physics-physx": {
|
||||
"_value": false
|
||||
},
|
||||
"physics-builtin": {
|
||||
"_value": false
|
||||
},
|
||||
"physics-2d": {
|
||||
"_value": true,
|
||||
"_option": "physics-2d-box2d"
|
||||
},
|
||||
"physics-2d-box2d": {
|
||||
"_value": false
|
||||
},
|
||||
"physics-2d-builtin": {
|
||||
"_value": false
|
||||
},
|
||||
"intersection-2d": {
|
||||
"_value": true
|
||||
},
|
||||
"primitive": {
|
||||
"_value": false
|
||||
},
|
||||
"profiler": {
|
||||
"_value": true
|
||||
},
|
||||
"occlusion-query": {
|
||||
"_value": false
|
||||
},
|
||||
"geometry-renderer": {
|
||||
"_value": false
|
||||
},
|
||||
"debug-renderer": {
|
||||
"_value": false
|
||||
},
|
||||
"particle-2d": {
|
||||
"_value": true
|
||||
},
|
||||
"audio": {
|
||||
"_value": true
|
||||
},
|
||||
"video": {
|
||||
"_value": true
|
||||
},
|
||||
"webview": {
|
||||
"_value": true
|
||||
},
|
||||
"tween": {
|
||||
"_value": true
|
||||
},
|
||||
"terrain": {
|
||||
"_value": false
|
||||
},
|
||||
"tiled-map": {
|
||||
"_value": true
|
||||
},
|
||||
"spine": {
|
||||
"_value": true
|
||||
},
|
||||
"dragon-bones": {
|
||||
"_value": true
|
||||
},
|
||||
"marionette": {
|
||||
"_value": false
|
||||
},
|
||||
"custom-pipeline": {
|
||||
"_value": false
|
||||
}
|
||||
},
|
||||
"includeModules": [
|
||||
"2d",
|
||||
"animation",
|
||||
"audio",
|
||||
"base",
|
||||
"dragon-bones",
|
||||
"gfx-webgl",
|
||||
"gfx-webgl2",
|
||||
"intersection-2d",
|
||||
"particle-2d",
|
||||
"physics-2d-box2d",
|
||||
"profiler",
|
||||
"spine",
|
||||
"tiled-map",
|
||||
"tween",
|
||||
"ui",
|
||||
"video",
|
||||
"webview"
|
||||
],
|
||||
"noDeprecatedFeatures": {
|
||||
"value": false,
|
||||
"version": ""
|
||||
},
|
||||
"flags": {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
/* Base configuration. Do not edit this field. */
|
||||
"extends": "./temp/tsconfig.cocos.json",
|
||||
|
||||
/* Add your custom configuration here. */
|
||||
"compilerOptions": {
|
||||
"strict": false
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user