LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

How do I make this code work better? (unsolved)

Root / Programming Questions / [.]

spaceturtlesCreated:
acls
option strict
load "grp4:parts",false
 
var wl=11,wx,wy
var wormx[wl],wormy[wl],wormr[wl],wtmp
var i,cx,cy
wormx[0]=200:wormy[0]=120

for i=1 to len(wormx)-3
 spset i,12
 spscale i,3,3
 sphome i,8,8
 next
spset 0,15
spscale 0,3,3
sphome 0,8,8 'head
spset wl-2,11
spscale wl-2,3,3
sphome wl-2,8,8 'head
 
@a
stick out cx,cy
 
wtmp=wormx[0]
unshift wormx,wtmp+cx*5
wtmp=pop(wormx)
 
wtmp=wormy[0]
unshift wormy,wtmp-cy*5
wtmp=pop(wormy)
 
for i=0 to wl-2
 spofs i,wormx[i],wormy[i]
 next

vsync
goto @a
I need to make the "worm's" segments spaced out as it moves. I also need to make the segments follow the head's rotation so the worm looks like one whole thing. What code do I need to add to make those happen?

maybe post a key, and I'll take a look at it.

EKS3X39P