Pages

Monday, 27 May 2019

coding with spheros using blocks and text (almost died, scary, gone wrong, NOT CLICKBAIT, GIVE AWAY) disclaimer the stuff in brackets is clickbait

during dte this topic we were doing the topic bits and bots the point of this topic was to show us how to do simple block code and expand on this topic how we did this was we used spheros .spheros are tennis ball size sphere with two motors and other pices of fwing here is my code is text form
var blah = 0;


async function startProgram() {
setMainLed({ r: 0, g: 255, b: 0 });
setMainLed({ r: 0, g: 255, b: 0 });
setStabilization(false);
for (var _i0 = 0; _i0 < 100000; ++_i0) {
if (Math.sqrt((getAcceleration().x ** 2) + (getAcceleration().y ** 2) + (getAcceleration().z ** 2)) > 1.11111111) {
setMainLed({ r: 255, g: 0, b: 0 });
await rawMotor(getRandomInt(101, 255), 255, 12);
await delay(2);
await rawMotor(getRandomInt(103, 255), 255, 12);
await delay(3);
setMainLed({ r: 0, g: 255, b: 0 });
await speak('A story', false);
await speak('I am a beautiful day. I am a beautiful day. It will not sure how I am   going through my email is the  Most important to you, but ', true);
exitProgram();
} else {
await roll(15, 255, 3);
}
await delay(0.025);
}
}

async function onLanding() {
await spin(500, 3);
if (getConnectedRobotType() === RobotType.Sphero) {
await rawMotor(255, -124, 6);
}
}
registerEvent(EventType.onLanding, onLanding);

async function onCollision() {
await strobe({ r: 255, g: 0, b: 0 }, 24, 200);
await rawMotor(255, 47, 12);
await delay(5);
await rawMotor(255, 47, 12);
await delay(3);
}
registerEvent(EventType.onCollision, onCollision);

async function blahBlahBahh(red, blue, green, red1, blue2) {
}
and now block form with a bunch of rando stuff
i really enjoyed making the spheros spaz out and draining the batteries for Mr carter. and learning how to make variables and make the chose of different thing happen depending on what happens. such as the orientation, speed, force of movement . the the best part was figuring out how to make it spaz out.
what sort of game would you make ? 
the place were i got my inspiration from is https://edu.sphero.com/cwists/category

1 comment:

  1. Hey Cameron,

    This is a pretty good Blog post. Yes you have clearly rushed it in parts (and put down the bare minimum) but you have really shown a depth of learning and understanding of coding. Keep developing (and playing) your coding using online tools!

    Well done!

    ReplyDelete

To support my learning I ask you to comment as follows:
1. Something positive - something you like about what I have shared.
2. Something helpful - add more info or ask me a question.
3. Something thoughtful - how have you connected with my learning?

Note: only a member of this blog may post a comment.