I was bored so I wanted to try and make my own game in processing (a platformer). So far so good, but a friend told me it would be cool if the game had moving platforms, the problem is I dont really have an idea how to make that for my game.
I create the levels for my game with the help of a double array:
example:
So now I want to program the 2 last blocks, TILE_MOVEX and TILE_MOVEY, if I can do one I could probably do the other one aswell, but I dont really know how to make a moving block here.
With a moving platform I mean a block (rectangle, basically as the TILE_SOLID, but the TILE_MOVEX has to move from left to right all the time and the TILE_MOVEY has to move up and down ofcourse.
So does anyone know how to make a rectangle in this code that moves like 2 grids to the right and then back to left again all the time?
EDIT: I did create this as an example of what I want, but Im not really sure how to implement this in my code for the game.