ageibert

Members
  • Content Count

    27
  • Joined

  • Last visited

About ageibert

  • Rank
    Member
  • Birthday 12/04/1976

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1061 profile views
  1. I see. That's a good idea. I'll work it out. Thank you!
  2. Hi @all, i'd like to "insert" crafting into my game. Something like: I pick up item A and afterwards item B. If both find i can craft an item C from both. Does anyone have links/infos or own experience how to implement crafting?
  3. Although i'm also using gulp more often than grunt i think that you set up some got tasks code here. Maybe you could put it on e.g. github so others could contribute. Nice work!
  4. I had the same problem and did also choose the inheritance method. Here's some code that could help: The main Level "class" all Levels inherit from: https://github.com/geibi/phaser/blob/master/js/Level.js There i got some "parentCreate" and "parentUpdate" etc. function which are called by the child Level classes e.g. https://github.com/geibi/phaser/blob/master/js/Levels/Level_2.js Here you see e.g. in line 21 BasicGame.Level_2.prototype.update = function () { this.parentUpdate();and after the update, all other functions for this specific level are called hope this helps
  5. moveToXY(displayObject, x, y, speed, maxTime) → {number}Oh this is great! Thanks a lot for that one, i read it completely wrong. I uploaded a new version and this is so much better than the old one now. But i feel the enemies could move even more intelligent. I you got any other ideas that would be great. ... and i fear that i must implement some sort of pathfinding because they get stuck on objects (the barrel/the skeleton)
  6. Hi jpdev, these are really good points. Yes, the problem is, that i want different enemies moving at different speed. that's why i established the "movementTime" variable, but there's an error in it's calculation, because enemies move slower at small distances... This is another problem i'm facing, but after your info and some rethinking i figured it out to move the enemies constantly if they got aggro now. Sadly i now got the same problem, that the enemies slow down the nearer they are to the player's position. Enemies only adjust their movement-target when the player first comes into aggro range and then again after they collide with something.And this is my biggest problem. I need to use "game.physics.arcade.moveToXY". Otherwise, e.g. with tweening, i don't get physics and enemies won't collide with walls. This is explained here: http://www.html5gamedevs.com/topic/10508-sprite-movement-movetoxy-vs-using-tween With tweening, which i implemented before, enemies can easily change their direction because i got an "onComplete" event. However with moveToXY and don't have any chance to move to another direction because i don't know when the movement (former: the tween) is completed. Here i'd need a much better way to determine the random movement, but that's exactly my point because i don't know how I updated the files and i think you have to reload your browser.
  7. first of all: i really like phaser! rarely seen such a clean and easy lib i finished my first goal with setting up a tile map, player movement, shooting bullets, enemy movement - and collision. the result can be seen here: http://test.geibi.de/phaser now i want to establish a more "juicy" or intelligent enemy movement. by now my enemies are moving somehow boring. the code for the movement can be seen here: https://github.com/geibi/phaser/blob/master/js/Actor.js and here in the "move()" function could anyone suggest a better movement method? maybe some sinus calculations or something else? also sometimes the enemies "wiggle" for some milliseconds which is also not really nice. and the code for the movement itself seems a bit circumstantial. but i don't have a clue how to make it better. thanks a lot for any suggestion edit: take care! if the player is in aggro range, enemies move towards him/her causing him/her loosing hitpoints. if the player dies you have to reload, because there's a bug on player death which causes javascript to quit
  8. edit: i played the game a lot myself and it's really also the bullets that behave like described above. the bullets do hit the whole visible sprite of enemies/bosses, but the player is able to move "behind" the enemies. it would be too frustrating for the player if he/she can't move behind a super sized screen filling boss - and if he/she could only hit the boss at some smaller physical body maybe i can find a better video with bullets
  9. ok, i see. so you think i'd better go off for p2 physics right now? not that i invest too much time in arcade physics and at the end have to refactor lot of code...
  10. i've chosen the body.drag solution and tweaked it with setting the speed (velocity increment) accordingly. additionally i set the maximumVelocity, so that the player doesn't accelerate too much. now my player still slides a bit, but that's ok for me. Thank you for that!
  11. Hi lewster, thanks for your outstanding answer and visualization. But i'm still not sure which solution to pick, because in all cases i'm missing something. Sorry. Maybe this video helps: https://www.youtube.com/watch?v=CAAxzC_KASg#t=138 At 2:18 you see the player running behind the boss. This is possible, because the bosse's body is, i think so, smaller than it's sprite. As well in width, but also in height. But: The player is able to hit the boss from top to button. The whole sprite area is listening for the players bullets/lasers to hit. If i offset the body of the boss, there would be unexpected collision outside the sprite image. Also if i'd make my bullets/lasers body as high as the bosse's sprite, it would produce unexpected collision e.g. if it misses by flying some pixels under the bosses sprite, but then still hitting him, even if not really touching it. Maybe i understood something wrong in your solutions?
  12. Hi @lewster32, that's an interesting idea for other scenarios i also need. Thanks for that! But what i try to achieve here is that the bullet does not only collide with the body of the player (green area), but with the whole sprite representation so that the player can be hit anywhere. Although the player has it's body only set to a small part of the whole sprite.
  13. my problem is that moving the player by velocity results in a feeling of sliding on ice (in my top down game). i want it more like normal walking, but still preserve the collision detection.
  14. Hi @rich, this would be the first step. I uploaded a visualization with what i want to achieve: http://files.geibi.de/collision.png The blue square is my player object. The body is set smaller to the green area. Now it's possible, that i overlap e.g. the barrel a bit (blue area) so that the player is not colliding with his/her head which would be wrong in this perspective (compared to the wall's perspective). This works fine. But i got enemies shooting bullets at the player. And these bullets should not only collide with the player's body, which would result in "headshots"beeing not possible, but with the whole blue sprite area.
  15. i need a way to set my player body smaller than its sprite/image representation, so it can overlap collision objects e.g. walls in a top down game. is it possible to set the body of a sprite object smaller than the sprite (yes it is) but check the collision with enemy objects, in particular enemy bullets, against the player sprite (not the now smaller body)? i hope this question is not confusing too much