need help with war game (Im using tables) please look :) *FIXED*

-Timo--Timo- Member Posts: 2,313
edited July 2013 in Working with GS (Mac)
hey guys
I am working on a war game, you have a 2 bases, the enemy has 2 bases and there is 1 neutral base.
every second every base gets 1 soldier more (just a number) when you slide from a base to another base the 'soldiers' walk to the base you slide to. when you slide to your own base the 'soldiers' in that base gets more and when you slide to an enemy or neutral base the 'soldiers' get less. (so when you have 10 'soldiers' in your base and slide to the enemy with also 10 'soldiers' then 5 'soldiers of yours walk to the enemy and the enemy base gets -5 'soldiers'.

but this is not working properly... when I slide from my base to the enemy and there is only 1 group of soldiers 'walking' then the enemy gets less, thats good. but when I send 2 groups of soldiers (fast after each other) its doesn't work good...
lets say the base his 'soldiers' is 100. when you slide to the enemy twice the first 'group of soldiers' is 50 and the second 25.
but the base gets 50. so after you send the second group it should be 25 but its 50...
and when the first group gets to the enemy base the enemy base gets +25 (because of the second group) but the first group is 50 so it should be +50. Im using a table.
PM me if you think you can help :) would be really appreciated... :D
thanks! :)

-Timo-

Answers

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Doesn't sound like the table is the issue. Post the rules you are using.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    you'll have to post samples of your code, what you are describing is a little difficult to understand.
  • -Timo--Timo- Member Posts: 2,313
  • -Timo--Timo- Member Posts: 2,313
    hmm... lets say there are 2 bases, 1 enemy base with 100 'soldiers' and your base also with 100 'soldiers', if you download this https://www.dropbox.com/s/h0ahk05wslxxyhq/War game.zip you'll understand better what I mean I think... :) you can send your 'soldiers' to the enemy by touching on your base and release when you touch the enemy's base. every time you send 'soldiers' the half of the 'soldiers' you have in your base will be send. so when you have 100 'soldiers', only 50 will be send. when the 50 soldiers touch the enemy base the the amount of 'soldiers attacking' will be removed from the enemy's soldiers in there base (so when there are 100 soldiers in there base and 50 are 'attacking' there will only be 50 enemy soldiers left) this works fine but when I send 2 groups of 'soldiers' it doesn't work good.
    Problem 1:
    if the soldiers in your base are 100 and you send 2 'groups of soldiers' then the first group will be 50 soldiers and the second group will be 25 soldiers. when the first group (50 soldiers) arrives at the enemy base there should be removed 50 soldiers. but there are 25 soldiers removed...<- not good. and when the second group (25 soldiers) arrives they also remove 25 soldiers(<- is good)

    Problem 2:
    this is hard to explain but I will try ;) if you have 100 'soldiers' in your base and you send a group of soldiers then there will be spawned a square(the soldiers) on the base. when this collides with a base you get the soldiers in your base. so when you have 100 and you send 50 to a base of with 50 soldiers they have 100 soldiers. so when you spawn you also get them back to your own base... I fixed the first group of soldiers you send but when you send the second group of soldiers you get them also in you own base and also in another base...

    Download link: https://www.dropbox.com/s/h0ahk05wslxxyhq/War game.zip
    if you try what I explained you will see the problem ;)
    I really hope someone can help me!
    Thanks ;)

    -Timo-

  • -Timo--Timo- Member Posts: 2,313
    other download links dont work... here is the good one :) https://www.dropbox.com/s/h0ahk05wslxxyhq/War game.zip
  • -Timo--Timo- Member Posts: 2,313
    bump ^^
  • -Timo--Timo- Member Posts: 2,313
    please can someone help me? I really need help with this
  • -Timo--Timo- Member Posts: 2,313
    *FIXED*
Sign In or Register to comment.