Page 10 of 10

Re: Zed98: Beyond The Day (?)

PostPosted: November 14th, 2011, 8:45 am
by fourinone
Zed98 wrote:
Code: Select all
moving = random_range(0,2)
dirswitch = random_range(0,2)
if dirswitch = 2
{
if dir = 0
{
dir = 1
exitrest = 1
}
if dir = 1
{
if exitrest = 0
dir = 0
}
exitrest = 1
exitrest = 0

}

There seems to be a potential source of error here. The random_range function returns a random real number between the two arguments, not only integers (so random_range(0,2) can return 1.287492, for example). Thus, the chance of (dirswitch == 0) is extremely unlikely. Also, the value it returns is inclusive for the lower argument but is NOT inclusive for the top argument, so (dirswitch == 2) is actually impossible. What you probably want is floor(random_range(0,3)); this returns an integer 0, 1, or 2. Also for the record, floor(random(3)) would return the same values as well.

I only scanned over the code briefly, so there may be more bugs in there, but there's a start.

Re: Zed98: Beyond The Day (?)

PostPosted: December 14th, 2011, 8:34 am
by Megar
Um, crap. I lost the sprites... Do you have any spare copies, Zed?
EDIT: I've just thought of a style for playing.
Ever played Sonic Heroes? No? Well, In it you are a team of 3. Speed, Power and Fly. However, to suit the four characters, there would be
Speed (Zed) Jump (Ciaran) Balance (Miranda) Strength (Luis)

Alsooooo

MOAR NAME CHANGE
Real Name Get! Make it Ellis. (It be my real name)