/
domahes
/
Arcade
Обзор
Документация
Войти
/
domahes
/
Arcade
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
js/data/DAnimRect.js
75 строк
1 KB
domahes
Initial commit with game files
01 июн 2026, 09:31
01 июн 2026, 09:31
0f50ffb
Код
Авторство
О чём код?
/** * Created by Yitian Chen on 2019/1/7. * Data structure of single animation frame */ function DAnimRect(rd){ var _sf = this; //Offset X in the image this.x = 0; //Offset Y in the image this.y = 0; //width this.width = 0; //height this.height = 0; //Offset X this.dx = 0; //Offset Y this.dy = 0; //Wait time this.time = 0; //Attack Frame or not this.effective = false; //SE this.sound = ""; //Volume of SE this.volume = 80; //Emission point this.points = []; //Read data this.x = rd.readInt(); this.y = rd.readInt(); this.width = rd.readInt(); this.height = rd.readInt(); this.dx = rd.readInt(); this.dy = rd.readInt(); this.time = rd.readInt(); this.effective = rd.readBool(); var length = rd.readInt(); for(var i = 0;i<length;i++){ this.points.push(new APoint(rd)); } this.sound = rd.readString(); this.volume = rd.readShort(); this.getRect = function(){ return new IRect(_sf.x,_sf.y , _sf.x + _sf.width, _sf.y + _sf.height); }; this.collisionRect = new ARect(rd); } /** * Emission point */ function APoint(rd){ this.x = 0; this.y = 0; this.x = rd.readInt(); this.y = rd.readInt(); } /** * Collision Area */ function ARect(rd){ //Auto correct this.auto = rd.readBool(); this.x = rd.readInt(); this.y = rd.readInt(); this.width = rd.readInt(); this.height = rd.readInt(); }