This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-08 14:22:56

brayney
New Scratcher
Registered: 2011-10-18
Posts: 2

Character selection

Hi, i am having to do a scratch project in my ICT GCSE however i am a bit of newbie when it comes to scratch.

My problem is that i have to make a set of criteria of what my game will be like and i have said that i want the game to have a character selection screen that allows the user to pick from a male character and a female character. That is the easy part.

However i have three levels in my game and i was wondering if i would be able to copy and paste the script from the male character into the female characters script with a couple of minor changes? or would i have to do two seperate scripts? I am on a time limit (20 hours) however and i am not the quickest on scratch so i doubt i would be able to do two seperate main character scripts.

Any help offered would be greatly appreciated.

Brayney

Offline

 

#2 2012-02-08 14:47:34

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Character selection

Based on what the user has chosen you could do something like this:

when gf clicked
set [gender v] to [boy]
forever
    if <key [Left Arrow v] pressed?>
        if <(gender) = [boy]>
            switch to costume [boy_left v]
        end
        if <(gender) = [girl]>
            switch to costume [girl_left v]
        end
    end

    if <key [Right Arrow v] pressed?>
        if <(gender) = [boy]>
            switch to costume [boy_right v]
        end
        if <(gender) = [girl]>
            switch to costume [girl_right v]
        end
    end

Offline

 

#3 2012-02-08 15:09:51

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Character selection

Magnie wrote:

Based on what the user has chosen you could do something like this:

when gf clicked
set [gender v] to [boy]
forever
    if <key [Left Arrow v] pressed?>
        if <(gender) = [boy]>
            switch to costume [boy_left v]
        end
        if <(gender) = [girl]>
            switch to costume [girl_left v]
        end
    end

    if <key [Right Arrow v] pressed?>
        if <(gender) = [boy]>
            switch to costume [boy_right v]
        end
        if <(gender) = [girl]>
            switch to costume [girl_right v]
        end
    end

or you could use :

when gf clicked
forever
if <key [left arrow v] pressed?>
switch to costume [(join[(gender)][left])]
end
end

Last edited by TRocket (2012-02-08 15:28:51)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#4 2012-02-16 13:14:42

brayney
New Scratcher
Registered: 2011-10-18
Posts: 2

Re: Character selection

Thank you very much!

I have decided that it won't be too hard to make the character selection after all, I will just have to dedicate a couple of lessons to making the variables work.

Once again, thanks a million

Brayney

Offline

 

Board footer