Project Prophecy: Beyond The Day

If you're making a game, you can post about it here.
Forum rules
If you want to post a topic, you have to post some progress to show you are working on the game. Screenies or Video.

Re: Zed98: Beyond The Day (?)

Postby fourinone » November 14th, 2011, 8:45 am

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.
ImageImageImage
YOU ARE NOW MANUALLY BREATHING
User avatar
fourinone
Honorary Member

 
Posts: 542
Joined: August 1st, 2009, 3:27 pm

Thumbs Up given: 5 times
Thumbs Up received: 40 times

Re: Zed98: Beyond The Day (?)

Postby Megar » December 14th, 2011, 8:34 am

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)
User avatar
Megar
Follower of Razputin

Error contacting Twitter
 
Posts: 2482
Joined: December 31st, 2009, 3:08 am
Location: On the Steel Ball Run

Runolympics 2015 Winners

Thumbs Up given: 42 times
Thumbs Up received: 147 times

Previous

Return to Game Showcase