How i do setup platform wars game?

0 favourites
From the Asset Store
Source file (commented event sheets), art and all music included and 100% royalty free.
  • Guizmus, thank you for replying

    i understand just now after i read your code slowly

    but i got the question again, if i have enemy and player with same spesification*, with your code

    why the player always win? and the enemy attack only once?

    (*)

    HP = 5

    AttPow = 1

    AttSpeed = 7

    The winner is player with 4 HP

  • yosualb

    They don't have the same specifications in what I wrote. Click on the player and the on the enemy, you'll see.

    Enemies are attacking for 1 damage every 5 seconds, player every 2 seconds for 2 damage. It's normal the player wins ;) Just check the object Properties, not their common family.

    An no problem for everything, no need to thank ^^

  • Guizmus, thank you for replying

    no no, i already edit your specifications with my specification.

    in my investigation, its like if the collision sprite is stand at rather left, the first player sprite only attack once,

    and if the collision sprite is stand at rather right the first enemy sprite only attack once

    sorry for my thank, but its my style at forum <img src="smileys/smiley36.gif" border="0" align="middle" />

  • yosualb

    Could you re-send me the last version so I can take a look ? I'll come back to you on the subject later, have to go now, but you are not far from getting it working ! Faith and Courage ! (ok, this was too much)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Guizmus, thank you for replying

    here is Collision Test(1).capx

    oh yeah, i got an enlightenment,

    if the collision position rather right because the player overlaping the enemy and enter the first if condition

    if the collision position rather left because the enemy overlaping the player and enter the third if condition

    maybe you can add something for equalize them?

    [UPDATE]

    hmm, i think the timer is the problem

    if i spawn player first, and then spawn enemy

    the timer of enemy is didnt start, any idea?

  • I would just add in a variable instance for each character that shows how often they strike (StrikeVar) (say 200 for example). Then every tick add their attack speed to another variable called "WaitHit" or something.

    If WaitHit > StrikeVar set WaitHit to 0. Play animation attack.

    If Player animation attack is playing, and player is overlapping enemy subtract player.AttPow from enemy.HP.

    I wouldn't worry about timer just yet.

  • AnD4D, thank you for replying

    And if i get 2 Player for attack 3 Enemy, i want to attack 1 on 1 Enemy. Why?

  • hi Guizmus, your code has been updated by me

    the problem is the timer, i change the timer with Cooldown behavior (created by Rex)

    anyway, thank you for helping

    maybe next problem i will discuss here again <img src="smileys/smiley20.gif" border="0" align="middle" />

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