
-----------------------------------
beedub
Sun Jun 15, 2003 10:41 pm

randomly moving
-----------------------------------
i need something to randomly move across the screen 10 times in any direction. So in this case lets make it a circle..

-----------------------------------
Andy
Mon Jun 16, 2003 9:28 am


-----------------------------------
use xchange and ychange

-----------------------------------
krishon
Mon Jun 16, 2003 9:48 am


-----------------------------------
do u mean like it goes to a random location 10 times?

-----------------------------------
Andy
Mon Jun 16, 2003 10:02 am


-----------------------------------
ya if u want it to show randomly just do this

for i:1..10
cls
drawfilloval(Rand.Int(0,maxx),Rand.Int(0,maxy),10,10,i)
delay(100)
end for
 

-----------------------------------
Tony
Mon Jun 16, 2003 10:41 am


-----------------------------------
i think he ment randomly move, not appear...

say princial appliest though. Randomly generate a number from 1 to 4, that would determine in which direction piece would move.

if move=1 then
%move north
...
etc

-----------------------------------
Homer_simpson
Mon Jun 16, 2003 11:01 am


-----------------------------------
View.Set("offscreenonly")
const xspeed := 1
const yspeed := 1
var y, x := 100
loop
    x += Rand.Int (-xspeed, xspeed)
    y += Rand.Int (-yspeed, yspeed)
    drawfilloval (x, y, 10, 10, 12)
    View.Update
    delay(5)
    drawfilloval (x, y, 10, 10, white)
end loop


-----------------------------------
krishon
Mon Jun 16, 2003 11:02 am


-----------------------------------
ye, that works, lol

-----------------------------------
JayLo
Mon Jun 16, 2003 12:17 pm


-----------------------------------
looks freaky though. I think he meant like bouncing? iunno. he isn't making it clear.

-----------------------------------
Andy
Mon Jun 16, 2003 2:38 pm


-----------------------------------
i dun think so, i think he's trying to make a space shooter or something

-----------------------------------
Homer_simpson
Mon Jun 16, 2003 3:06 pm


-----------------------------------
ic... ok i'll try to make a smooth moving one...

-----------------------------------
Homer_simpson
Mon Jun 16, 2003 4:23 pm


-----------------------------------
how bout this one?!
proc rotate (OriginX, OriginY : real, var secondpartX, secondpartY : real, Rotaion : real)
    var tempx := (((OriginX - secondpartX) * cosd (Rotaion)) + ((OriginY - secondpartY) * sind (Rotaion)))
    var tempy := (((OriginY - secondpartY) * cosd (Rotaion)) - ((OriginX - secondpartX) * sind (Rotaion)))
    secondpartY := OriginY - tempy
    secondpartX := OriginX - tempx
end rotate
View.Set ("offscreenonly")
const factor := 200
const speed := 1
var xx, yy : real := 200
var xr, yr := 100
var slope := 0.0
var i : int
loop
    i := 1
    xr := Rand.Int (-factor, factor)
    yr := Rand.Int (-factor, factor)
    xr += round (xx)
    yr += round (yy)
    loop
        i += 1
        rotate (xr, yr, xx, yy, speed)
        drawfilloval (round (xx), round (yy), 5, 5, 9)
        View.Update
        delay (5)
        exit when i = 10
    end loop
end loop

-----------------------------------
Andy
Mon Jun 16, 2003 4:39 pm


-----------------------------------
man homer, u have too much free time, anyways if they're looking for mods, you should be their first pick and catalyst of course

-----------------------------------
Homer_simpson
Mon Jun 16, 2003 6:51 pm


-----------------------------------
the code above took me less than 10 mins =)

-----------------------------------
Andy
Mon Jun 16, 2003 7:27 pm


-----------------------------------
ya but ten minutes can get u 5 marks on an exam if u use it to study

-----------------------------------
PaddyLong
Mon Jun 16, 2003 10:38 pm


-----------------------------------
study?? pffft  the only studying you need to do is a once over of your notes :o  people worry way too much about the numbers they get in school

-----------------------------------
Andy
Tue Jun 17, 2003 10:20 am


-----------------------------------
notes? what notes... i just memorize the text book 8)

-----------------------------------
krishon
Tue Jun 17, 2003 10:20 am


-----------------------------------
i dun't think that's a good way of studyin, especially for application problems

-----------------------------------
Andy
Tue Jun 17, 2003 10:21 am


-----------------------------------
ya but chinese ppl are good at application, its the theory that kills us

-----------------------------------
krishon
Tue Jun 17, 2003 10:22 am


-----------------------------------
lol, not for me, its the other way around, y r u azn?

-----------------------------------
Andy
Tue Jun 17, 2003 10:23 am


-----------------------------------
yepp, mandrine and proud

-----------------------------------
krishon
Tue Jun 17, 2003 10:25 am


-----------------------------------
lol, nice, i thought u were caucasian or somethin

-----------------------------------
Andy
Tue Jun 17, 2003 10:28 am


-----------------------------------
uhhh, that's nasty, well you know we can just go to the chat room and talk eh? but anyways, this gets me bits

-----------------------------------
krishon
Tue Jun 17, 2003 10:30 am


-----------------------------------
haha, yah..this is the only way left, after hte other one was moved to spam....but the original post was spam..so its not our fault.....or is it  :wink:

-----------------------------------
Andy
Tue Jun 17, 2003 10:31 am


-----------------------------------
oh well, hope they guy wouldn't be mad at us and still let us be mods

-----------------------------------
krishon
Tue Jun 17, 2003 10:32 am


-----------------------------------
lol, we're like the only ppl other than him and maybe darkness that know bout it

-----------------------------------
Andy
Tue Jun 17, 2003 10:33 am


-----------------------------------
lol, no one reads the spam section, u dun gets bits so y waste time?
