Chairs

Posts
18
Karma
28
posted this 12 May 2017

The drum character works quite well as a chair. This is how I coded it.

 

Kodu:

 

WHEN Keyboard Space DO Jump (Makes Kodu jump when space bar is pressed.)
WHEN Keyboard Up DO Move Forward (Makes Kodu move forward when up arrow key is pressed.)
WHEN Keyboard Left DO Turn Left (Makes Kodu turn left when left arrow is pressed.)
WHEN Keyboard Right DO Turn Right (Makes Kodu turn right when right arrow is pressed.)
WHEN Keyboard W DO Move Forward (Makes Kodu move forward when W key is pressed.)
WHEN Keyboard A DO Turn Left (Makes Kodu turn left when A key is pressed.)
WHEN Keyboard D DO Turn Right (Makes Kodu turn right when D key is pressed.)

 

Drum (muted, immobile):

 

Page 1:

 

WHEN DO Ignore (Otherwise, the camera will follow both Kodu and all chairs.)
WHEN Got Kodu White DO (Only allow Kodu to turn the chair or get off if sitting.)
    WHEN Keyboard Left DO Turn Left (Allows the chair to turn left.)
    WHEN Keyboard Right DO Turn Right (Allows the chair to turn right.)
    WHEN Keyboard A DO Turn Left (Allows the chair to turn left.)
    WHEN Keyboard D DO Turn Right (Allows the chair to turn right.)
    WHEN Keyboard Up DO Drop (If the character moves forward, it gets out of the chair.)
        WHEN DO Switch Page2 (Otherwise, Kodu will get off and on repeatedly.)
    WHEN Keyboard W DO Drop (If the character moves forward, it gets out of the chair.)
        WHEN DO Switch Page2 (Otherwise, Kodu will get off and on repeatedly.)
    WHEN Keyboard Space DO Drop (If the character jumps, it gets out of the chair.)
        WHEN DO Switch Page2 (Otherwise, Kodu will get off and on repeatedly.)
WHEN Got Anything Not DO
    WHEN See Kodu White InFront DO (Makes sure that Kodu only sits down if touching the front of the chair.)
        WHEN Bumped Kodu White DO Grab It (Makes Kodu sit in the chair.)
            WHEN DO Switch Page2 (Otherwise, Kodu will get off and on repeatedly.)

 

Page 2:

 

WHEN Timer .25 Seconds .25 Seconds DO Switch Page1 (Otherwise, Kodu will get off and on repeatedly.)

 

I used a creatable and copied it so that I did not need to change the code for every single chair. You may want to adjust Drum p2's timer depending on Kodu's speed. It looks great from the back, though not the best from the top.

 

 

 

Post Edited 14 May 2017

1
Marcos Echeita Sarrionandia
Posts
41
Karma
55
Marcos Echeita Sarrionandia posted this 14 May 2017

Could you upload a world to the community and give us the link?

 

Thanks in advance

0
Posts
18
Karma
28
posted this 14 May 2017

Of course! That is, if Kodu doesn't crash again...

0
Posts
18
Karma
28
posted this 14 May 2017

There we go. "Share with community" was not working. I'll have to write a report on that. Here's the link: https://worlds.kodugamelab.com/world/YXOiiMntm0aYRViitIKvtw==

 

EDIT #1: Whoops! The D key made Kodu turn left instead of right.

 

EDIT #2: Changed drum's rotation speed to be much faster.

Post Edited 14 May 2017

1
Marcos Echeita Sarrionandia
Posts
41
Karma
55
Marcos Echeita Sarrionandia posted this 16 May 2017

I have already downloaded the world
It works perfectly with the version: Kodu 1.4.186.0.
I thought it was a good idea
Regards

0