David Higuita

Members
  • Content count

    15
  • Joined

  • Last visited

  1. Settings (game.cofig)

    Hello, What are all the config keys for game.config, so I need to know How can I move engine folder to a general directory to be re-used for all games and in every game develop the modules tha I need. I mean I, I would like get this structure: . ├── README.md ├── assets │ ├── Audios │ └── Images ├── common │ └── pandajs │ └── engine └── src └── demo ├── game │ ├── background.js │ ├── board.js │ ├── box.js │ ├── frog.js │ ├── index.js │ ├── interactiveimage.js │ ├── mainText.js │ ├── step1.js │ ├── step2.js │ ├── step3.js │ └── utils.js ├── index.html └── settings.js
  2. Drag and Drop

    @Ninjadoodle Thanks a lot, I made s little test with mousemove and touchmove, but need improve it, I'll watch it.
  3. Drag and Drop

    Hi, Is possible make drag and drop using panda.js? So I have did it on pixi.js, but testing panda.js I love it, so get many good things, but now the only thing that I haven't did it is make drag and drop, I have tested events like mousedown, mouseover, but mousemove doesn't exist, but I don't know if I can add event listener to a sprite o or how can I solve this situation. Thanks.
  4. Use panda with ES6

    Hi, How can I use panda with ES6? I mean, I downloaded the code (with get an index.html, engine and game dorectories) I have tested and in main.js works fine, but I want to import panda on another javascript file to get all core using the import, just import game from 'engine/core' But i get a small object, but doesn't get a full object, for example, I don't get the complete object My structure is this . └── demo ├── _demo │ ├── assets │ │ └── Images │ │ ├── frog.jpg │ │ └── logo.png │ └── settings.json ├── app.js ├── index.html ├── js │ └── pandajs │ ├── engine │ │ ├── analytics.js │ │ ├── audio.js │ │ ├── camera.js │ │ ├── core.js │ │ ├── debug.js │ │ ├── keyboard.js │ │ ├── loader.js │ │ ├── particle.js │ │ ├── physics.js │ │ ├── pixi.js │ │ ├── pool.js │ │ ├── renderer.js │ │ ├── scene.js │ │ ├── storage.js │ │ ├── system.js │ │ ├── timer.js │ │ └── tween.js │ └── game │ ├── config.js │ └── main.js ├── media │ └── logo.png ├── scss └── styles.scss This is my app.js file import game from './js/pandajs/engine/core'; game.module( 'game.main' ) .body(function() { game.addAsset('logo.png', 'logo'); game.createScene('Main', { backgroundColor: 0xb9bec7, init: function() { var logo = new game.Sprite('logo'); logo.anchor.x = 0.5; logo.anchor.y = 0.5; logo.position.x = game.system.width / 2; logo.position.y = game.system.height / 2; this.stage.addChild(logo); var tween = new game.Tween(logo.scale); tween.to({ x: 1.1, y: 1.1 }, 1000); tween.repeat(); tween.yoyo(); tween.start(); } }); }); And I want use the app.js to import panda and create my game with classes. Is it possible? I want to do it to because we need create many simple games, but I have tested pixi.js and really doesn't like me and I want to use panda but I must use it with ES6 Thanks
  5. Support Panda.js

    Perfecto, so I think that I will change Pixi to Panda, so we need simple games and must being very fast, and really I have loved features of panda. Thanks
  6. Support Panda.js

    @Ninjadoodle Great, so really at the begining I think pixi is good, but when I seen Panda.js I loved it, so has many good things, for example better way to make animations, scenes, etc. Now I am testing Pixi to make many games, but really I have had many problems, and have been some hard make animations fine. Knowing this, I have only one question in this moment, What framework (or library) is better to mane games (pixi, the current version of panda (or wait next updates), or what option )? I mean, we need an option to learn the basic quickly, so I have used pixi almos two weeks and really my advances aren't so good and I need this weekend get a demo. Thanks.
  7. Support Panda.js

    Hi, Is good idea today use panda.js?, so I understand that panda isn`t updated and in the repo las commits are of three years ago, and I am studying Pixi.js and I have many questions and dicumentations isn't enought, so for example I want to use scenes, make good animations but with pixi has been complicated for me. Thanks.
  8. Error using pixi-sound (fs)

    Hello, I am using pixi-sound on a game with pixi.js and now I can't start my game because I get an error for the fs ERROR in ./node_modules/pixi-sound/dist/pixi-sound.es.min.js Module not found: Error: Can't resolve 'fs' in '/Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/dist' resolve 'fs' in '/Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/dist' Parsed request is a module using description file: /Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/package.json (relative path: ./dist) Field 'browser' doesn't contain a valid alias configuration after using description file: /Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/package.json (relative path: ./dist) I installed v2.0.0-alpha so on github told me that this version solve it. Do you know what might be? Thanks
  9. Multiple animations with ticker

    With this new structure works fine. I changed my structure, and now is working, now I must solve how can I add to an animation fileset, so that was a real problem Thank you
  10. Multiple animations with ticker

    @ivan.popelyshev Thanks for all, I tried with next code and worked fine, but in my game structure doesn't work fine.I want to ask you, What is the best way to make the game using classes? I mean, separate sprites by classes and that each one get on its constructor another sprites to use them and apply on them animations. import * as Pixi from 'pixi.js'; import './styles.scss'; const initConfig = { antialias: false, transparent: true, resolution: 1, }; const app = new Pixi.Application(window.innerWidth, window.innerHeight, initConfig); document.querySelector('.pixi-container').appendChild(app.view); // sprites let Frog; const rotateAnimation = () => { let counter = 0; let motion = 0; const animation = () => { if (motion === 25) { app.ticker.remove(animation); } else if (counter === 5) { Frog.rotation += 0.1 * 0.005; motion += 1; counter = 0; } else { counter += 1; } }; app.ticker.add(animation, Pixi.UPDATE_PRIORITY.NORMAL); }; const randomMotion = () => { let counter = 0; let motion = 0; const animation = () => { if (motion === 20) { app.ticker.remove(animation); rotateAnimation(); } else if (counter === 5) { Frog.x += 10; Frog.y += 5; motion += 1; counter = 0; } else { counter += 1; } }; app.ticker.add(animation, Pixi.UPDATE_PRIORITY.NORMAL); }; Pixi.loader .add('frog', './assets/Images/frog.jpg') .load(() => { Frog = new Pixi.Sprite(Pixi.loader.resources.frog.texture); app.stage.addChild(Frog); app.renderer.render(app.stage); // animations randomMotion(); });
  11. Multiple animations with ticker

    Perfect, so like this is a thing of the job I can't share it, but I don't know if you know where is an example with one of these cases to watch how are many animations on an app. I'll make a similar demo like the job code and share it with you. Thank you.
  12. Multiple animations with ticker

    I changed const to let and doesnt work, I don't know why Thanks for help
  13. Multiple animations with ticker

    @ivan.popelyshev I made what you tell me and if I want when finish current animation (myTween) start another animation doesn't start, and I don't know if is for the remove, and I have tried removing that function and only call another animation and it fails. initFrogAnimation() { let counter = 0; let frames = 0; const animation = () => { if (frames === 12) { this.app.ticker.remove(animation); this.moveFrog(); } if (counter === 20 && frames < 13) { counter = 0; frames += 1; this.Frog.choose(frames); } else { counter += 1; } }; this.app.ticker.add(animation, Pixi.UPDATE_PRIORITY.NORMAL); } moveFrog() { let counter = 0; let motion = 0; const animation = () => { if (motion === 20) { this.app.ticker.remove(animation); } else if (counter === 5) { this.Frog.sprite.x -= 5; this.Frog.sprite.y += 1; counter = 0; motion += 1; } else { counter += 1; } }; this.app.ticker.add(animation, Pixi.UPDATE_PRIORITY.NORMAL); } What is wrong? I have readed source but I can't solve my questions. Thanks again
  14. Multiple animations with ticker

    @ivan.popelyshev Thank you for the answer, I'll test it on a moment, so I have reviewed the source, but I don't understand somethings but is great.
  15. Multiple animations with ticker

    Hello, I am developing a game, and in a parte o this I need move and sprite and after some events move many sprites, but using app.tocker.add doesn't work In a first part I used this code to move a box appearBoxOrigin() { let counter = 0; this.app.ticker.add(() => { if (counter === 35) { counter = 0; this.app.ticker.stop(); this.addInteractiveImagesToOriginBox(); this.appearBoxHighLow(); } else { this.Boxes.origin.sprite.x -= 10; counter += 1; } }); } Afer I used this another code to move another sprite, but code doesn't work, doesn't show error, only doesn't run, I don't know if is because I use stop function to stop the animation. I'd like know How can I use ticker to make animation, how can I start and stop, and really I don't understand how make animations, so I use this counter but making essay and error but I'm not sure. this.app.ticker.add(() => { if (counter === 0) this.app.ticker.start(); if (counter === 35) { counter = 0; this.app.ticker.stop(); this.appearLoftSoftBoxes(); } else { this.Boxes.targetHigh.sprite.x -= 10; this.Boxes.targetLow.sprite.x -= 10; /* this.interactiveImages.map((image, index) => { this.interactiveImages[index].setPosition( { x: this.interactiveImages[index].x - 1, y: this.interactiveImages[index].y }, ); return null; }); */ counter += 1; } console.log('ticker move images'); }); But my variable this.interactiveImages (a class) seem like render again and show me an error on the constructor of these variables.