Hi there
@Purplepickle
Instead of :
Quote: "If ax# > x# then ax# = ax#-.2
If ax# < x# then ax# = ax#+.2"
You could get last x#,y# position of your sprites and restore when you need it.
ink rgb(0,255,0),0
box 0,0,5,10
get image 1,0,0,5,10,1
sprite 1,300,150,1
ink rgb(100,80,50),1
`starting position values
x#=300 :y#=300
sync on
do
ink rgb(255,255,0),1
line 250,200,250,400
line 400,200,400,400
line 250,200,400,200
line 250,400,400,400
`last x,y position before moving
lx#=x#
ly#=y#
`sprite movements left/right/up/down
if leftkey() then x#=x#-0.5
if rightkey() then x#=x#+0.5
if upkey() then y#=y#-0.5
if downkey() then y#=y#+0.5
if x#<250 or x#>395 then x#=lx# else if y#>390 or y#<200 then y#=ly#
sprite 1,x#,y#,1
sync
loop
Edited
Another example with a bucle .
autocam off
sync on
ink rgb(200,0,0),0
box 0,0,3,10
get image 1,0,0,10,10,1
for i= 1 to 20
sprite i,rnd(200),rnd(200),1
offset sprite i,1.5,5
next i
position camera 0,800,0
point camera 0,0,0
do
for i= 1 to 20
x=sprite x(i)
y=sprite y(i)
if rnd(5000)=2 then rotate sprite i,45
if rnd(5000)=3 then rotate sprite i,90
if rnd(5000)=8 then rotate sprite i,180
if rnd(5000)=10 then rotate sprite i,270
if x<10 then rotate sprite i,90
if x>200 then rotate sprite i,-90
if y<10 then rotate sprite i,180
if y>200 then rotate sprite i,0
move sprite i,0.1
next i
sync
loop
Cheers.
I'm not a grumpy grandpa
