Up and across, tiles and actor? [SOLVED]

SomeT

  • Posts: 143
I am trying to do something similar, but  instead of up key adding rows and down key deleting rows, I would want it to be

1. if Drop (actor 1 colour) MATCHES to player / actor 2 (names not specific to my code but you get the idea) COLOR then delete row as long as its not 7
2. if Drop DOES NOT MATCH to player / actor 2 COLOR then add row even if its 7 (This seems to work ok I think it is just number 1 that I can not get working)

But at 0 (the top of the screen) it goes to game over
and at 7 (the bottom of the screen) this initial row of tiles never deletes.


Overall from looking at your code I still can't figure out how to get what I want to achieve in this, which is highlighted in a red square in my initial code, would /32 and +2 have the same effect on my code?




« Last Edit: January 16, 2017, 05:59:27 pm by SomeT »

ceosol

  • *
  • Posts: 2279
My mochi was 64x64. So /32 +2 takes the row at his "feet". Your thing looks like 32x32, so /32 +1 should do it.

SomeT

  • Posts: 143
Yeah that is correct, it is 32x32, I have tried even just doing this function as + or - rowcount now on its own and it does not work, I have tried to go off from your code blocks but it just does not pick anything up at all, do you have any idea what I could be doing wrong now? I think it is the function and my logic, possibly even have to do as a seperate event? I have no idea its driving me insane now, lol. If you can help me fix this it would be much appericiated:

http://pasteboard.co/nDC0ALqyM.png

ceosol

  • *
  • Posts: 2279
Your otherwise if is never firing.

1st condition - if animation P = animation LCA

If that is true, it will do whatever is inside of those blocks. If it is not true, your otherwise if would never happen.

2nd condition - if animation P = animation LCA AND other things

You are already saying that the animations are not the same because your first condition has to be false for the second condition to be checked. Have your rowcount>=1 and rowcount <=6 inside of the first if statement.

If animation P = animation LCA
    If rowcount>=1 and rowcount <=6
        do the eliminate row stuff
    otherwise
        do the non-eliminate row stuff

SomeT

  • Posts: 143
Ok I am finally getting somewhere, I have now tried the following, I feel like my range is messed up somehow because sometimes it will work perfectly and sometimes it won't depending on what row its on, so I am thinking it is either my logic or I am nesting my if function incorrectly and it should be a otherwise if or not? I tried to look in a programming logic and design book to figure out the precise logic of the nesting here working with the logic but have ended up with the following which is kinda working now but not 100% any further advice would be much appericiated, the part is outlined in red again:

http://pasteboard.co/nKmUDmcG4.png

Just for clarification again, row number 7 is the initial / first row and should never be removed, it then counts down to the top, when it reaches 0 it initiates game over

SomeT

  • Posts: 143
Update:

After doing a few playthroughs to try and understand now what is wrong exactly, when I am on the first colour (red) it works perfectly, it deletes rows as it should, if I am matching either of the two other colours (blue or green) of LCA or Player 1 it does not work at all. I am really baffled by that as the same function above works perfectly in the same kind of way, only difference is, the second if function for removing the rows says 'and' twice, is this the problem?

SomeT

  • Posts: 143
Ok it just suddenly clicked what I needed to do, after reading what you said and what I just written in the update, it is apparant that its already checking the colour so if it checks it twice, it is resulting as a double positive = 1 = red only, where if I take that out and just check the row count it then proceeds to check all three colours as initially I wanted it to, see the following, case closed, this thread can be marked as solved now, lol.

http://pasteboard.co/nKULzWRc6.png

CmdrWhitey13

  • Posts: 505
You yourself can modify the title as solved. You have the power.

SomeT

  • Posts: 143
Done, sorry still new here.

ceosol

  • *
  • Posts: 2279
Yes, you got it. Sorry, I was out or I would have responded :)

SomeT

  • Posts: 143
Yeah no worries, sometimes just talking to myself helps haha. Helps me to outline and break down the problem in order to come to a solution kind of like rubberr duck debugging.