Pages: 1
Topic closed
The level system in my game works by adding two to the level variable every level (because each level has two costumes). I'd like to do a level select cheat, but I'm doing it by asking the player what level they'd like to go to. If the answer is even, then the cheat doesn't work and the game breaks. How can I make sure that the number is always odd (without having to tell the player to enter an odd number)?
Offline
if <(answer mod 2) = 0> then
JUMPLEVELCODE
else
BREAKLEVEL
Offline
SeptimusHeap wrote:
if <(answer mod 2) = 0> then
JUMPLEVELCODE
else
BREAKLEVEL
Alright, thanks .
Offline
fullmoon wrote:
Another way:
Code:
if((number/2) = round(number/2)) ...Captain Superfluous saves the day.
That's easier to use since I don't know what mod does .
Offline
Sunrise-Moon wrote:
fullmoon wrote:
Another way:
Code:
if((number/2) = round(number/2)) ...Captain Superfluous saves the day.
That's easier to use since I don't know what mod does
.
"Mod" is short for "modulus", which is basically a fancy word for the remainder of a division operation. So 23 mod 7 is 2 because 7 goes into 21 evenly with 2 left over.
Offline
If you want to know what a block does... look it up on the Scratch Wiki
Scratch Wiki article
Offline
Jonathanpb wrote:
If you want to know what a block does... look it up on the Scratch Wiki
![]()
![]()
Scratch Wiki article
xD ok. On the subject of the Scratch Wiki, my username doesn't work with the password that was assigned to me.
Offline
Sunrise-Moon wrote:
Jonathanpb wrote:
If you want to know what a block does... look it up on the Scratch Wiki
![]()
![]()
Scratch Wiki article
xD ok. On the subject of the Scratch Wiki, my username doesn't work with the password that was assigned to me.
Really? Try copying and pasting in the password given to you to make sure that you didn't take a l for an I or something like that. Make sure that the account name you put in at the login is the exact same as your Scratch username (don't do Sunrise-moon when your Scratch username is Sunrise-Moon, those types of things). If it still doesn't work, sowwee (I was the one who created your account, so if something went wrong with the password it's my fault xD) - e-mail scratcherswiki@scratch.mit.edu, stating the problem (I think that's the wiki's e-mail address), or just give JSO a comment about it
Last edited by Jonathanpb (2010-12-01 00:31:47)
Offline
Jonathanpb wrote:
Sunrise-Moon wrote:
Jonathanpb wrote:
If you want to know what a block does... look it up on the Scratch Wiki
![]()
![]()
Scratch Wiki article
xD ok. On the subject of the Scratch Wiki, my username doesn't work with the password that was assigned to me.
Really?
Try copying and pasting in the password given to you to make sure that you didn't take a l for an I or something like that. Make sure that the account name you put in at the login is the exact same as your Scratch username (don't do Sunrise-moon when your Scratch username is Sunrise-Moon, those types of things). If it still doesn't work, sowwee (I was the one who created your account, so if something went wrong with the password it's my fault xD) - e-mail scratcherswiki@scratch.mit.edu, stating the problem (I think that's the wiki's e-mail address), or just give JSO a comment about it
![]()
Ah, it was a problem with the username (lack of capitals). Alright, thanks for the help .
Offline
Sunrise-Moon wrote:
Jonathanpb wrote:
Sunrise-Moon wrote:
xD ok. On the subject of the Scratch Wiki, my username doesn't work with the password that was assigned to me.Really?
Try copying and pasting in the password given to you to make sure that you didn't take a l for an I or something like that. Make sure that the account name you put in at the login is the exact same as your Scratch username (don't do Sunrise-moon when your Scratch username is Sunrise-Moon, those types of things). If it still doesn't work, sowwee (I was the one who created your account, so if something went wrong with the password it's my fault xD) - e-mail scratcherswiki@scratch.mit.edu, stating the problem (I think that's the wiki's e-mail address), or just give JSO a comment about it
![]()
Ah, it was a problem with the username (lack of capitals). Alright, thanks for the help
.
Offline
Topic closed
Pages: 1