• Content Count

  • Joined

  • Last visited

About cpu_sam

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Tu é BR? Lançou em que ano e mês? Só pra dar um feedback a mais aqui pra gente. 20 mil download é muito bom, eu lancei um jogo de matemática na playstore e só teve pouco mais de 120 downloads lá, mas em outras store teve quase 700 downloads.
  2. Are you using firefox? That is a bug not solved in the browser. Chromw has not this bug, for this I use chrome on dev of my game. Here talk that bug was solved, but in new versions of firefox it still persists: https://bugzilla.mozilla.org/show_bug.cgi?id=637449
  3. @Exca thanks for your advice, I'll take a look at the Haxe.
  4. Hahaha I cryed of laught here. I will change to javascript and wait not have so many troubles as with typescript. Thank you.
  5. Hahaha man, I can't express myself here cause of my limitation with English. But, you are a great person @ivan.popelyshev, I started to follow your work with Pixi some time ago and I see that you have MANY will to help people. So, apart this. I never will go back to typescript, never in my life I had so close to have a heart attack because of a language. Well, I came from using Phaser 2 with typescript and many problems happened, configure a simple project was hard as hell. C++ is so far easily than typescript and you not wast time configuring vscode. And yes, I configured the Pixi properly like it should be, and even had problems. I'm using this language for some months and had many, many problems. So to keep my health and sanity, I give up of this lang. I will use javascript... only when I take a piece of cake and drink some coffee at morning.
  6. Sorry for this... but I HATE TYPESCRIPT!!!! Oh my god, almost I had a 'piripaque' here. Solved, I will to javascript, never in this life I want to program in typescript again!
  7. how can I extends the AnimatedSprite from pixi 4.8.7? I'm not able to do this in vscode because it says that the constructor of base class (AnimatedSprite) should be 0 args but got 2. Why this? Se my code: import 'pixi.js'; export class Animation extends PIXI.extras.AnimatedSprite { constructor (name:string, textures:PIXI.Texture[], loop:boolean=true) { super(textures,loop); this.name = name; this.anchor.set(0.5); } } I'm using typescript. At the line with the super give error in vscode, and the this.name and anchor it like if not exist. What should I do?
  8. @ivan.popelyshev thanks, I will look the example. @jonforum but, I know how it works. What I don't understand is, why when set scale.x to -1 the boundary of the image of the sprite goes to left of the top left corner position. I came from frameworks where that (the scale) doesn't affect the boundary of the texture draw on the screen. For example, with SDL2 you can flip horizontally the drawing but the boundary doesn't change to left (outside of the top left corner). I know that I'm need to know something, but I don't know what is haha. maybe realtive to the transform matrix, or something made inside the pixijs that I can see directly. Others engines made the scale like pixijs, for that, I'm certain that I'm forgetting to learn something.
  9. @b10b man, great idea use as child. I will use this in my game. Thank you!
  10. before that, I've ready search the google, this forum, stack overflow, and found only broken answers. My doubt: -how can I flip a single sprite in Pixi? What I need: -flip the sprite BUT hold its center (width/2, height/2) in the same place like it was not flipped, without change the anchor. Example: Before: After flip X: NOTE: the sprites stays in the same place X and Y. So how can I do this? Second question: After flip the sprite, how to rotate with origin in its center? The sprite is in the smae position, but I want rotate only relative to width/2 and height/2, and not with the anchor. I've tryed set the pivot to center of size but the sprite is moved to the anchor. Is possible do this without gambling with anchor?
  11. Just see the debbug log. It's impossible to give some notion without see any log.
  12. [NOTE: sorry for the post resurrection, but we can learn a bit more with it) Maybe you already solved that, but I will make some observations: You MUST study about state machines, basically I'm talking about automaton finite deterministic (AFD) For example, with a AFD, you can control each state of the entity and change when the player or AI changes: //NOTE: this object.state goes in object as a member, assign its value to IDLE (first state) function update ( ) { switch (object.state) { case IDLE: { //the idle code stay here } break; case WALK: { //the walk code stay here } break; case JUMP: { //the jump code stay here } brek; default: object.state = IDLE; break; } } And so, you must change the object state through the variable member object.state Think like if each state was independently of each other. So, the IDLE has the own code, WALK has another and JUMP has other. Each state process the input with diferents ways, see like a code can be: //NOTE: this object.state goes in object as a member, assign its value to IDLE (first state) function update ( ) { switch (object.state) { case IDLE: { //the idle code stay here //process inputs in IDLE state if (keyPressed == RIGHT || keyPressed == LEFT) { object.state = WALK; break; } //this function check if the object is touching the ground if (!object.isGround())//if no { object.state = FALL; break; } } break; case WALK: { if (!object.isGround()) { object.state = FALL; break; } //the walk code stay here //process input in WALK state if (keyPressed == RIGHT) moveToRight(); else if (keyPressed == LEFT) moveToLeft(); //should be stop else { object.state = IDLE; break; } } break; case JUMP: case FALL: { //the jump/fall code stay here if (keyPressed == RIGHT) moveToRightOnAir(); else if (keyPressed == LEFT) moveToLeftOnAir(); //if touchs grounds is idle if (object.isGround()) { object.state = IDLE; break; } } brek; default: object.state = IDLE; break; } } In the code above, we can see that each state holds diferents codes, it's more modular, and any state can survive without any other state. What can I say with all things? Simple, with state machines your code will stay more readable and easy to expand to more complex code without lost of sense. Imagine a code with 8K lines, if you follow making the code like you were making, you will finish in problems. If you use the state machine way, your code will stay more easy to mainutence. Now the jump problem. In the code that I show to you, you can verify if the player is jumping over the enemy or just falling above it. Just check the object.state value and you'll see what the player is acting. So in this way, you just need add more code on the JUMP/FALL state part and check if the enemy is down on the player feet. If so, you can die the enemy calling a method inside the own enemy (something like enemy.kill()) to send the message to enemy do the kill()