Custom Map #1953: Adaptive Current. By: Lewmas

Started by AutoPost, September 04, 2023, 07:28:20 PM

Previous topic - Next topic

AutoPost

This topic is for discussion of map #1953: Adaptive Current


Author: Lewmas
Size: 256x144

Desc:
I made a PRPL thing to activly adjust fields to match current flow, then wanted to show it off so I made this map.

Lewmas

Here's my PRPL if anyone wants it.
# --Create Field-- 9/4/2023 1:11:05 PM
Once
CreateList ->AllParticles
-1 ->PID
EndOnce
#Make a list of all particles
ClearTraceLog

0 0 1000 1 1 GetParticlesInRadius ->AllParticles #pull all Enemy particles
<-AllParticles GetListCount 0 do #move list to stack
<-AllParticles[I]
Loop

0 0 1000 1 0 GetParticlesInRadius ->AllParticles #pull all friendly particles
<-AllParticles GetListCount 0 do #move list to stack
<-AllParticles[I]
Loop

CreateList ->AllParticles <-AllParticles AppendStackToList #set the stack to be the list

<-AllParticles GetListCount eq0 not If
#create 10 fields
10 0 do
#pick a random particle
<-AllParticles #add list to stack
0 <-AllParticles GetListCount 1 sub RandInt #Pick a random number between 0 and the end of the list
GetListElement ->PID #Pull PID and store it in ->PID
<-PID GetParticlePosition PixelToCell
-4 4 RandInt add
swap -4 4 RandInt add swap
#x1 y1
<-PID GetParticleMotion 40 div #n2
swap 40 div #n1
SetFieldCell #[ x1 y1 n1(up) n2(right) - ]
Loop
EndIF

#decay old fields
20 0 do
RandCoords SetCurrentCoords #pick a spot
CurrentCoords 0.0 0.0 SetFieldCell #remove Field
Loop