Random Complex Movement Loops


was8bit 2022-04-23 16:04

Hold finger on screen to reset

Jeanmilost 2022-04-24 13:12

So if I understood well, you execute a symertical path, in which the half is inverted to always restart from the starting point, right? Good concept 🙂may be useful for a cyclic path, e.g for an enemy in a game which need to follow a predefined guarding path

was8bit 2022-04-24 14:32 (Edited)

Thanky :)

Well, i started with the concept as doodles on paper... the initial code didn't perform as the doodle did, so i carefully analyzed how i made the doodle, then rewrote the code again... again the code still didn't perform correctly, so i kept hacking at the code until it did what i wanted ;)

I do two sets of movement... the first movement isnt as smooth as i wanted, but close, and has 3 randomly created moves, with a full circle divided into 8 segments, and each move may do 1 to 7 segments alternating cw,ccw,etc for each move...

then the second set of movements simply performs the same 3 moves but in such a way that the piece is returned to the starting point

was8bit 2022-04-24 14:36 (Edited)

If anyone is wanting a predefined path, someone has already created one that also includes an editor... mine is designed to be random...

... and actually as is cannot really be used in a game because the code executes the loop completely before it can returned to processing anything else...

... i am currently reworking the code so it performs only a pixel movement at a time, for up to 3 different pieces, and also can process a game in between each pixel movement...

This has inspired a simple game, which i am currently fleshing out :)

was8bit 2022-04-24 14:56

Here is a sneak peek on what i am working on...

Alien Attack 4.nx | Open in app
2022-04-24 14:56

was8bit 2022-04-24 14:58 (Edited)

As you see i have removed looping (DO LOOP) from each movement portion, and also added a simple "flip movement" option, so pieces can now start and execute their movements from either side....

freeing the movement from its DO LOOP wasnt easy as i had to add tweaks throughout and inbetween the 4 sets of DO LOOPS for the movement as a whole to execute the whole movement properly...

Its also going to take a lot of recoding to get all 3 their own independent movements... but i enjoy this... its better than doing premade puzzles or playing any game that will soon become predictable.. working on code is pure joy for me :D

GAMELEGEND 2022-04-24 17:07

can't wait for the new game!

Jeanmilost 2022-04-24 18:47

Indeed the game seems promising. Using a such movement as a set of random patterns for a shoot-em’up is also a great idea 🙂well done

was8bit 2022-04-25 05:06

Thanky :)

The game will be more for proving i can write the code that will get all 3 pieces doing their own movements, so the game will be kept as simple as possible...

I already have it programed for 4 different gameplay speeds, but need to add more code to get the game working as ive envisioned it...

I got lucky that the movement thing worked and works better planned.... maybe i'll get lucky with the game too ;)

was8bit 2022-04-27 00:34

Finally got the movements satisfactory!!!


Log in to reply.