Showing posts with label chapter 7. Show all posts
Showing posts with label chapter 7. Show all posts

Saturday, August 8, 2020

Start and Stop - ALICE Program

 Stop and Start

Choose a ride object other than the carousel from the Amusement Park gallery that moves in a circular pattern (a round-and-round manner, like the Ferris wheel). Create a method that performs an animation appropriate for the ride object selected. Then, create a way to start and stop the ride using the While something is true event.

Start and Stop


Solution:

Add a button to the world to start and stop the ferris wheel animation. The button toggles the state, one click starts the animation, the next click stops it. And the animation runs infinitely.

This question is to teach how to use repetition, loops and events.

See the attached video created using Alice 2.5 for this program, using the actual source code

Contact me @ allassignmenthelp@gmail.com for the comprehensive step-by-step guide on how to create this game in ALICE as well as the final source code. I can modify the program if you would need any changes.


Tuesday, November 6, 2018

Spinning Stars - ALICE Program

Spinning Stars


This exercise provides a world in which to explore using world-level functions to control
the execution of a loop. A knight has been thrown from his horse and stars are spinning
above him. We want to allow the user to control how the stars start and stop
spinning by moving the mouse cursor near the left or top edge of the window. While the
mouse is near the top or left edge of the window, the stars will start and continue spinning.
However, when the mouse is moved back towards the center of the world, the stars
should stop spinning. 
 To create this world, add a horse, a knight (both from Medieval), and a seeingStars
object (from Special Effects). Create a new method named spin  for the seeingStars
object. A “spin” is 2 revolutions, turning either left or right. In the spin  method,
the stars should spin left about half the time and spin right the other half. Create a
world-level function named nearTheEdge  that returns true  if the mouse is within
1 meter of the top or the left edge of the screen. Then, write a world-level method
named outOfBounds  that uses a while  loop to spin the stars as long as the mouse is near
the top or left edge of the screen. Use a While the world is running  event to call the
outOfBounds  method.

Hint: The world has functions that return the distance of the mouse from top edge and
from the left edge of the screen. Also, the world has a random probability function that
can be used to choose whether the stars turn right or left.


Solution:
The user moves his mouse near the left edge or top edge, the stars start spinning. When the user brings the mouse back to the center, the stars stop spinning. Similarly, if the user moves his mouse near the right edge or the bottom edge, the stars do not spin.

See the attached video created using Alice 2.4 for this program
This video is exported from Alice 2.4 from the actual source code of this program.

Contact me @ allassignmenthelp@gmail.com for the comprehensive step-by-step guide on how to create this game in ALICE as well as the final source code. I can modify the program if you would need any changes.

Sunday, May 14, 2017

Drinking Parrot - ALICE Program

Drinking Parrot

A small toy popular with children is a drinking parrot. The parrot is positioned in front of a container of water and its body given a push. Because of the counterbalance of weights on either end of its body, the parrot repeatedly lowers its head into the water. Create a simulation of the drinking parrot (Objects). Use an infinite Loop statement to make the parrot drink.

Hint: We used the blender object (Kitchen gallery), p
ushed the base into the ground, deleted the lid, and changed the color of the blender to blue to simulate a bucket of water.

                                                                                        

Solution:
In this program, when the user first clicks anywhere on the parrot, it starts moving up and down infinitely.
Below is the video for this Alice program, created using Alice 2.3


Contact me for the comprehensive step-by-step guide on how to create this game in ALICE as well as the final source code.