Strange Bullet Behavior, any ideas or suggestions?

0 favourites
  • 3 posts
From the Asset Store
Strange factory themed set of tiles for your platformer game
  • Hi everyone, so I'm making a simple homage to Kung Fu Master and while it's not done of course, I'm working on a system that allows enemies to randomly come from the left and right. I have a few variables I was using to help manage the game's controllers and applied this same approach fairly successfully with the enemies as well, but they show a strange behavior and I'm not sure why:

    http://part12studios.com/temp/Games/KFM/KFM_05/

    swipe left and right to move.. swipe up to jump and tap to stop.

    this is where i'm determining the bullet speed of the enemies.. i have a left enemy and a right enemy just to help keep things easy to manage.

    https://www.dropbox.com/s/gagajzmmbbdl7pd/kfm1.png

    so the idea is that if the player is in a moving right state, the left enemy bullet speed gets reduced and the right side goes faster.. and overall this works fine moving left and right, but when idle.. where i have both off thus making the speeds normal (400 and -400 respectively) things get weird.

    I don't get why. there are no other places in the game where bullet speed is changed. regardless if i set the bullet speed to all enemies to 0 or 400 / -400 (respectively again) the right guy continues to be in that stuck state..

    I wonder if it's something about using the (-) symbol in the formula, but all of my testing has been unable to find some common thread. Maybe it's something about using - and another - or something? like dividing by 0

    Thanks,

    Caleb

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's hard to tell by just that screenshot, but shouldn't it be "EnemyRight set speed 900" in event #7?

    If event #6 works correctly, this means that the angle of motion of EnemyRight is 180 degrees. So setting positive value to speed should move it from right to left.

  • yea i see now that i just had to work with positive numbers for the speed. worked it out. I was canceling out things by using negative values incorrectly.

    Thanks!

    Caleb

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)