Evar1ste

Members
  • Content Count

    6
  • Joined

  • Last visited

  1. Evar1ste

    Pixi-spine slots alpha manipulation

    Hey, thanks for response Well, it works when the slot has its alpha value constant during animation. But some of the slots has their respective alpha values animated (in my particular example from 0.45-0.55 and so on) so i can modify that value using TweenMax but autoupdating overrides my value with next from animation. So i want to ask if there is opportunity to NOT update single slot.
  2. Evar1ste

    Pixi-spine slots alpha manipulation

    Hey, I want to ask if there is any possibility to change alpha of a single spine slot if its alpha value is animated. The problem is that the slot is autoupdated and it causes alpha value to be set every single update. Currently i am using TweenMax and it works perfectly well if slot has static alpha value. Unfortunatelly setting autoUpdate to false for whole spine isn't an option. Thanks for help
  3. Evar1ste

    Organising Code

    @Zyie I started my adventure with PIXI from analyzing code on PIXI examples site. Then i found that boilerplate and start using it. But first of all u have to understand and be capable of writing code using ES6, cause the linked repo that i provided is using Babel compiler to rewrite your code into ES5 (i mean u still can stick to ES5 but ES6 is more similar to languages that you've been using). I think that there was a post about best practicies somewhere on forum (about best design patterns for creating new games and code structure). Gonna look for that post (not sure if it was here or on any other site).
  4. Evar1ste

    Pixi-particles Emitter position

    Ok, i changed "spell.update(delta)" to "spell.update(delta/60.0)" and now it works perfectly well. (excluding one spell but i think it's emitter settings related) Thank you for quick response
  5. Evar1ste

    Pixi-particles Emitter position

    I have an array of 'casted spells' in SpellManager object. Updating game, updates every single particleContainer aka spell. import Spell from './Spell'; import { Spellbook as SPELLBOOK } from './SpellTypes/Spellbook'; export default class SpellsManager { constructor(player, gameContext) { this.gameContext = gameContext; this.player = player; this.spellNames = SPELLBOOK.names; this.currentPlayerSpell = this.spellNames[0]; this.castedSpells = []; } nextSpell() { let nextIndex = this.spellNames.indexOf(this.currentPlayerSpell); nextIndex = ++nextIndex % (this.spellNames.length); this.currentPlayerSpell = this.spellNames[nextIndex]; } castCurrent() { const spell = new Spell(this.currentPlayerSpell, this.player); this.castedSpells.push(spell); this.player.parent.addChild(spell); } update(delta) { this.castedSpells.forEach(spell => { spell.update(delta); }); } }
  6. Evar1ste

    Pixi-particles Emitter position

    Hello, First post there, little bit nervous I am currently developing a little game using PIXI, but got stucked with pixi-particle related problem. Link to game As anyone can see my player 'spells' aka particles, are changing their respective position with their emitter (emitter and particles are moving). What i want to achive is comet-like animation (like when mousemoving, using Pixi-particles-editor). Let's proceed to the code. import { ParticleContainer, loader } from 'pixi.js'; import { Emitter } from 'pixi-particles'; import { Spellbook as SPELLCONFIG } from './SpellTypes/Spellbook'; export default class Spell extends ParticleContainer { constructor(name, player) { super(); super.setProperties({ scale: true, position: true, rotation: true, uvs: true, alpha: true }); this.name = name; this.playerName = player.name; this.spellEmitter = new Emitter(this, loader.resources.basicparticle.texture, SPELLCONFIG[name].emitter); this.spellEmitter.updateOwnerPos(player.x, player.y); this.direction = player.rotation; this.velocity = SPELLCONFIG[name].velocity; } update(delta) { const newX = this.spellEmitter.ownerPos.x + Math.sin(this.direction) * this.velocity; const newY = this.spellEmitter.ownerPos.y - Math.cos(this.direction) * this.velocity; this.spellEmitter.updateOwnerPos(newX, newY); this.spellEmitter.update(delta); } } Was trying to add resetTrackingPosition() before updateOwnerPosition() after analyzing pixi-particles example code. (and dozen of other solutions, but nothings worked as i intended) Imho, theres something deeply misunderstood by me about pixi-particles system, so i have to ask here Oh, whole game code can be found at my github project page. (Folder Spells is the one with particles code) There are spells named "avada", "bariero", "stupefy" with their configuration (precisely - emitter settings) files. PS. i am aware of particleContainers not being destroyed. PS2. Sorry for my English, it's not my native. But tryin my best