ModderDojo – Updated Scriptcraft Server

5 Feb 2016: I have compiled the latest version of Spigot (Version 1.8.8, 22 Jan 2016), which is a high-performancse server based on CraftBukkit, and added in the latest version of Scriptcraft (Version 3.1.12, 30 Dec 2015).

You can download it here: https://www.dropbox.com/s/9eg5e5j8j1ubr6w/2016-02-Spigot.zip?dl=0

The version of CanaryMod+Scriptcraft that we were running for the past couple of months was very unreliable, so hopefully this will be better!

Scratch Beginners – Challenge 10 – Maths Game

Wow! We had an exceptional day at Coder Dojo on Saturday! We did a huge amount of work developing a maths game in Beginner’s Scratch. My finished project is on the SCRATCH.MIT.EDU website under the user: CDATHENRY1516. Check it out and upload your final version!CDA-S5-Challenge_10-Maths game-how to

  1. the player picks a level of difficulty and the computer chooses 2 random numbers to add (subtract or multiply- whichever you choose!) together and show the numbers to the player. Fr this we needed 2 SPRITES and 4 VARIABLES called SCORE, LEVEL, NUMBER1 and NUMBER2 as well as 2 BACKDROPS. CDA-S5-Challenge_10-Maths game-ask questions1CDA-S5-Challenge_10-Maths game-ask questions
  2. The player then has to enter an answer to the equation and the computer tells them whether they are wrong or right. CDA-S5-Challenge_10-Maths game-decisions alternative end
  3. We repeated the ask/answer questions 5 or 10 times. Can you figure out where the REPEAT loop fits?
  4. We also had a second sprite who reacted positively to correct answers BROADCAST and negatively to wrong answers BROADCAST. You can use whatever sprites you like and change their look whatever way you like. One coder added a puppy as their second and had him bark whenever an answer was correct. CDA-S5-Challenge_10-Maths game-sprite 2
  5. After all the questions were asked we had the 1st Sprite SAY – Game Over! and BROADCAST Game over so that the backdrop changed and music played. There are two ways to change the backdrop- see below!CDA-S5-Challenge_10-Maths game-alt backdrop CDA-S5-Challenge_10-Maths game-backdropCan you improve our game??! Can you figure out how to subtract or multiply instead of add? Can you get the computer to add three numbers together or give the user 3 level options like: easy, medium or hard? The notes for the Maths Game are here: CDA-S5-Challenge_10-MathsGame-simple addition. Happy Coding! Julie

Beginner’s Scratch Challenge 9 – Storytelling

We had a great day in Scratch Beginners on Saturday! We created a project in which the Sprites all communicated through the use of broadcasts. Each broadcast caused a reaction in the other parts of the program such as the other sprites and even the stage. To begin, we all added two sprites from the library and two backdrops from the backdrop library to the stage. My sprites came with several costumes already supplied, but you can use whatever costumes you like. CDA-S5-Challenge_09-Storytelling-how to

Next, each coder had to decide on a story, conversation or a joke to have one sprite tell the other. After that we placed each character apart on the screen by using the GO TO: command and then had then move together using the GLIDE command. Each part of the conversation is shown on screen with the SAY FOR 2 SECONDS command after which the same words are broadcast to the whole program using the BROADCAST command. The second sprite responds to the first Sprite’s broadcast by SAYing his part of the joke and then broadcasting the same words. This goes back and forth until the story is finished. Keep trying out your scripting by pressing the GREEN FLAG and seeing how it is working. CDA-S5-Challenge_09-Storytelling-1st sprites script

CDA-S5-Challenge_09-Storytelling-2nd sprite script

At the very end, I have the 2nd Sprite send out a final broadcast which causes the backdrop to change and music to play while both Sprites simultaneously do a dance! I just threw that in for fun and to show that BROADCASTS can cause any part of the program to switch on or off. Here is the slide show if it helps a bit more: CDA-S5-Challenge_09-Storytelling. Also, I put my program up on the SCRATCH.MIT.EDU website for you to play with. Search for projects made by cdathenry1516. This project is called –JulieKnockKnockJoke23-01.

Hope to see you all next week when we work on a guessing a number game which requires input from the user to guess the number the computer has picked!

Julie

“Tick” Technique in Scratch – Illusions and 3D printing!

Today in scratch advanced, Mark covered a very useful method to organize your programs better if there are lots of moving sprites – which he calls the “tick” technique.tick_loop The idea is that a single master loop ticks time and the Sprites react to this tick in their own way.

We showed two examples of using this tick – an optical illusion that shows that things can move in circles while just doing straight lines and a technique for building 3D models by layering sprites the same way that a 3D printer layers resin.

illusion_path

 

The FULL Instructions for today’s projects are here – Enjoy!!

It would be great if you tried out some of your own Tick projects, and demonstrated them next week at Scratch Advanced!

Beginners Scratch – How to make an animated Christmas Scene

Because our last lesson on animation was cancelled, I thought I’d post a lesson online that the kids could access over the Christmas holidays. This Scratch project(Julie’s Christmas Scene) is on the Scratch.MIT.edu website user:cdathenry1516, pw:cdathenry if you want to download it to your computer.

Screenshot (3) I searched the internet for Christmas Cartoon Images and saved a few to my computer:Screenshot (14)

Once I had all the images I wanted for Sprites, I opened SCRATCH and imported the Sprites From File but I noticed that each Sprite had a white background that blocked my nice backdrop. I decided to delete the background from each sprite.christmas scene delete image background

I did this for all my sprites. Next I decided to make the dog wag is tail by

  1. Duplicating the doggie’s costume,
  2. using the select tool to select just his tail and then rotating the tail with the little button at the very top of the selection rectangle.christmas scene make tail wag edit costume

I did the same with Santa’s arm and his shoes. I just rotated them a bit in each costume, back and forth. christmas scene make santa dance edit costume christmas scene make santa wave edit costume

For the lights on one of the christmas trees, I just

  1. duplicated the tree costume 3 times,
  2. poured different colours into the round decorations in each costume.

Lastly, I scripted each of the Sprites like this:christmas scene snow flake script Christmas scene santa script Christmas scene doggie script

That last script is for the doggie! You can script your Sprites in any way you would like. Can you put in a snowman and make him dance about? or bounce around. Can you have presents dropping from the sky like my snowflakes??

Christmas Pizza Party next week!!! Don’t forget to wear a santa hat and decorations! Bring your favourite scratch project and we’ll show the rest of the Dojo!

Julie

Scratch Beginners – Week 8- Stop Motion Videos


Last Saturday, we had a fantastic time creating very simple stop motion videos in scratch by taking pictures of small figurines in sequence and then uploading the pictures from cameras and phones to the computer. We then started Scratch and added the very first picture as a SPRITE from a file. All the subsequent pictures were then added as new costumes to this sprite!

We did have to do a very simple code for the sprite – when the GREEN FLAG is pressed the sprite FOREVER uses the NEXT COSTUME command and WAITS .1 seconds. The computer then moves from the first costume down to the last, very quickly, but not so quickly that we can’t see it happen! The result looks like we have taken a video. Check out the scratch.mit.edu website for the demo that I used – Julie Animation. Search the site for cdathenry1516 games.animation code 2

Next week, we will take a look at Paint.net,which is a drawing program. I will quickly go through the menus but the best way to learn a program like this is to use it and experiment with it. We will use it to try to delete the backdrop from some of our pictures that were taken last week to see if we can make it transparent. When we do, we will be able to see our own backdrops in behind our characters.

Please download the Paint.net program from www.getpaint.net/download.html. Please be careful of ADS. Only download from the recommended site. I will bring a copy on a belt.

PAINTNET

 

Next week, the Moms and Dads should bring along a camera or phone along with the lead to download the pictures to your laptop.

Julie

 

Beginners Scratch – Week 7 – Breakout

***Next week we will be doing Animation! Please bring any miniature figures that you might want to use to create a short story through stop motion photography. We will also need some way to take photos and download the images to the computer – so parents need to remember a camera and download cables. I will bring a big load of modelling clay.***

Breakout is a variation of our previous game, Paddleball. We create a new scoring experience for our gamers by introducing blocks at the top of our screen that they get points for hitting.

CDA-S5-Challenge_04-Breakout-game view

Everyone already knew how to import or create the first two sprites – the paddle and the ball and most coders remembered from paddleball how to get the paddle to forever follow the mouse in only the x-direction. CDA-S5-Challenge_04-Breakout-paddle control

The code to move the ball was essentially the same as in the paddle ball game with a small change to broadcast the starting position to itself.CDA-S5-Challenge_04-Breakout-ball control 2

We then created two variables, one for the score which will go up when the ball hits a block sprite(can you copy this code from the Paddleball game code and use it in the ball sprite?) and one for lives which will go down every time the ball touches the end line we added under the paddle on the Backdrop. Can you figure out where to put the code to reduce lives by one when the ball touches a certain colour?CDA-S5-Challenge_04-Breakout-variables

Lastly, we created the block sprites and coded for them to fade away when they touched the ball. We use the EFFECT block of code in LOOKS.CDA-S5-Challenge_04-Breakout-brick script

The complete set of notes in .PDF format can be opened here:CDA-S5-Challenge_08_Breakout. You can play with my completed game on the http://scratch.mit.edu webpage. If you sign in as cdathenry1516 and use the password: cdathenry, you will be able to play all our games. If you have your own sign in name, just search for cdathenry1516 and you can see and play them all as well. Please put yours up there as well!CDA-S5-Challenge_04-Breakout-save to website

See you all next week!

Julie

 

 

Advanced Scratch Platform Engine part 1

Hey folks,  today we started on a platform engine that can be used as the basis for many games.  Mostly today we were trying to get the physics of it fairly right.  We had to solve a lot of problems to make it work the way we wanted it!  This involved:

  • figuring out how to do realistic gravity!
  • letting us bump head off platforms
  • sorting out the “pillar” problem where we pop to the top of pillars
  • jumping
  • walking up slopes
  • using hitboxes to avoid snagging our whiskers on ledges

platform_week1

Hold onto the project as we will come back to it and add some enemies and maybe build it into a game!

The full instructions for the project are here:

You can download the code here!  (Note to download the code, click on “View RAW” and it will get downloaded to your computer).

Beginners scratch week 6 – Pen Commands

Since we had a terrific guest speaker today, there wasn’t enough time to rework our paddle ball game to the famous breakout game, so I picked out the quick (but really neat) drawing game! The .pdf of the slides can be found here:CDA-S5-Challenge_08-Pen Command-CDA-S5-Pen Commands CDA-S5-Pen Commands-code

In order to make it easier to change the values that control the angles of the drawing and the length of the sides, we created variables that we could change via sliders on the STAGE (right click on the variable on the stage after you create it and a menu pops up giving you some options, including a slider option). CDA-S5-Pen Commands-slider variablesReplace the handwritten numbers in the TURN and the MOVE motion commands with the variables for speed and degrees. When you touch the green flag and start the movement of your sprite, you can slide the sliders to get the perfect (or craziest) drawing! Duplicate your sprite and get several sprites drawing at once.

One extra bit that we didn’t get to is to use buttons to start and stop our drawing. Create two new button sprites and script them to send a broadcast when clicked. CDA-S5-Pen Commands-buttons

Just edit the script in the drawing sprite by putting the WHEN I RECEIVE event command at the top of the drawing script and select the START broadcast. Add another bit to the drawing sprite to STOP ALL when it receives the STOP broadcast from the Stop button.

 

Next week we will do the breakout game and we will plan the animation project for the following week.

Don’t forget to upload your projects to the website: scratch.mit.edu! Put it on your own login and share it or put it on ours: cdathenry1516.

All the best,

Julie

 

 

 

 

Scratch Advanced – Gravity

Gravity

For the last two weeks we have been learning about Gravity and building a lunar module project to simulate how gravity works in the real world.

What is Gravity?

Gravity is what holds us down on Earth, if we jump up in the air, gravity will pull us back down.

If you want to break free of the Earths gravity you have to travel very fast and reach “escape velocity” this is about 25,000 mph.

The space station, even though it is travelling at 17,150 mph (that’s about 5 miles per second!)  has not escaped the Earths gravity, while it is trying to travel away from the Earth at 17.150 mph gravity is pulling it back down, this makes it travel around the Earth in an Orbit.

So we set out to build a Gravity simulation game.

In order to make it a little easier we decided to use the Moon as our base as the gravity is less and there is no atmosphere to slow us down when we are moving.

Some of the rules that we had to code for were:

  1. Our spaceship should not move if it is on the Ground.
  2. The higher it gets the faster it should move – Less Gravity.
  3. If it starts moving left or right, it should stay moving until it is stopped – No Atmosphere.

The Sprite needed 4 Costumes:

  1. Landed – This is the default costume where nothing is happening.
  2. Up – This costume has a flame coming out the bottom.
  3. Left – This costume has a flame coming out the right hand side.
  4. Right – This costume has a flame coming out the left hand side.

Costumes1234

Costume2Costume3Costume4

 

 

Once we had the sprite built we started on the code. We started with the left and right code first, basically when you clicked on either the left or the right button, we would change the costume and also increase or decrease a variable to indicate how far we should move along the X axis (this is the one that goes from left to right).

We used a variable for the LeftRight movement to make it simpler. This ended with some code that looked like this:

LeftCodeAnd for the Right Arrow Right

We put a small delay in as well, this gave the effect of the thrusting going on and off which looked more realistic.

The left right movement was taken care of by a separate piece of code that just keep moving the Sprite.

Main2

This also had a little bit of code to stop everything if we touched a particular colour, this was the colour of my landing pad.

For the Up Code we did something similar, but had to add in the movement in as well.

UpCode

To calculate the Up/Down movement was a little more complicated as we needed to adjust how much we moved up depending on how high we were, basically the Y value. Scratch doesn’t help here as the Y value goes from -180 to 0 and then on to +180, we needed it to always be positive, so we had to use a variable and add 180 to it.

The other thing we had to do was find a number that when we divided by the Y value it gave us a reasonable value to move the Sprite by, through trial and error this came out at 200.

Which ended up with some code like this:

Main1This code also has all of the initialisation code, where we set all the variables we are using to their initial values. Notice that the UpDown default is 1, this is to ensure that the first time that you press the Up key that the spacecraft actually moves.

And if you want all of the code, here it is

AllCode

And finally this is what my Project looked like in the end

FullProject