Showing posts with label Learning to program with Alice. Show all posts
Showing posts with label Learning to program with Alice. Show all posts

Monday, December 18, 2023

Connect 4 Game in Alice

 Connect 4 game - ALICE Program

Create a Traditional 2-player Connect 4 game using Alice. The 2 players take turns to play and drop their discs in a grid. The goal for each player is to make either a horizontal, vertical or diagonal line of one’s own discs. The player to do that first, wins the game.


Solution:
In this program, first it asks for the names of Player1 and Player2. Turn by turn, each player clicks on one of the position, to drop the disc. This program uses features such as, billboards, 3D text, Loops, If/Else, events, methods, camera positioning and dummy objects.
Here is a video of the Alice program, created using Alice2.5



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



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.


Monday, November 19, 2018

Tic Tac Toe - ALICE Program

Tic Tac Toe Game


2 player traditional tic tac toe game in Alice. Play the classic game of X's and O's
Each player takes turn to play this game. 

Solution:
Tic Tac Toe game in a grid of 3x3.
Each player takes turn to play X or O and at the end there is a congratulatory message at the end.

See the attached video created using Alice 2.4 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.

Monday, April 23, 2018

Faery Magic - ALICE Program


Faery Magic

Create a world that have at least 5 different objects from the Furniture Gallery and a Faery from the Fantasy/Faeries Gallery. The Faery has the power to make an object disappeared. Everything that the faery touches disappears from the scene. Create an interactive game where the user clicks one object at a time from the scene; then, the faery faces that object and moves in direction to it. Write a recursive method named CheckDistance, that checks whether the faery is very close to the object clicked by the user. If it is, the faery bends over to touch the object. After the faery touches the object, the object disappears (this is the base case of the recursion). If the faery is not yet close enough to the object to be able to touch it, the faery moves a small distance forward and the CheckDistance method is recursively called (this is the recursive case of the recursion). Also Create instructions for the game
      
     

Solution: 
The user clicks the object and Faery moves towards it to make it disappear.
See the attached video created using Alice 2.3 for this program

This video is exported from Alice 2.3 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.

Thursday, November 30, 2017

Why Did the Chicken Cross the Road? - ALICE Program

Why Did the Chicken Cross the Road?


A popular child’s riddle is, “Why did the chicken cross the road?” Of course, there are many answers. In this project, the chicken (Animals) has a real sweet-tooth and crosses the road to eat the gumdrops (Kitchen/Food) along the way.


Write a game animation where the player guides the chicken across the road to get to the gumdrops. Cars and other vehicles should move in both directions as the chicken tries to cross to where the gumdrops are located. Use arrow keys to make the chicken jump left, right, forward, and back. Use the space bar to have the chicken peck at the gumdrop. When the chicken is close enough to the gumdrop and pecks, the gumdrop should disappear.
A recursive method is used to control the play of the game. If the chicken gets hit by a vehicle, the game is over (squish!). The game continues as long as the chicken has not managed to peck all the gumdrops and has not yet been squished by a vehicle. If the chicken manages to cross the road and peck at all the gumdrops along the way, the player wins the game. Signal the player’s success by making 3D text “You Win” appear or by playing some triumphant sound.

Solution:
The user can move the chicken using arrow keys and help it cross the road and can press space bar to peck at the gum drops. Chicken will be able to peck the gumdrops only when it is near it.

See the attached video created using Alice2.3 for 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.



Wednesday, November 22, 2017

Ice Danger - ALICE Program

Ice Danger 

For this exercise, you can begin with a world completed in either Exercise 7 or 8—or create a new skater world from scratch. Add a hole in the ice (a blue circle).


Make the world interactive to allow the user to use the mouse to move the hole around on the icy surface. Now, as the skater is moving across the surface of the ice, the user can move the hole into the skater’s path. Modify your method that skates the skater forward to use an If statement that checks whether the skater is skating over the hole. If she is on top of the hole, she will drop through it. If you have sound on your computer, you may want to add a splash sound.

Solution: 
The user can move the blue hole with mouse (drag and drop motion) across the screen. If the ice dancer comes close to the hole, dancer falls into the hole.


See the attached video created using Alice 2.3 for 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.



Monday, November 20, 2017

Skydiving Guidance System - ALICE Program

Skydiving Guidance System


Alice Liddell (People) has taken up a new hobby: skydiving. She is on a helicopter (Vehicle), wearing a parachute (Objects). She is to jump to the carrier (Vehicle), which is a little way in front of her. In the world shown below, we added a half cylinder (Shapes) inverted and connected to the helicopter to be used as a jump platform. A torus (Shapes) was used to create a harness for Alice Liddell. (Although this isn’t absolutely necessary, it is helpful due to Alice Liddell’s small waist compared to the parachute’s cords.) 


             

The idea of this animation is to provide a skydiving guidance system to allow the user to guide the movement of Alice Liddell as she jumps from the platform of the helicopter and glides down to the carrier. When the user thinks Alice Liddell has hit the top of the carrier, the user can press the Enter key to have Alice Liddell drop her chute.

Guidance system methods (as smooth and lifelike as possible):

  • jump: jump from the helicopter’s platform 
  • glideForward, glideBack, glideRight, glideLeft: glide in the appropriate direction
  • swingLegs: legs swing a bit when gliding or jumping
  • dropChute: get rid of parachute (to simplify things, just have the chute rotate as if it were falling and make it disappear)
Keyboard controls:

  • Space bar—jump off the platform 
  • Up/Down/right/left arrow—glide forward/back/right/left
  • Enter key—parachute drops 
Remember that Alice Liddell should first jump off the platform prior to gliding and should not drop her chute until she hits the carrier.

Solution:

The program works with user interaction. When user presses "Space bar" it initiates the game and Alice jumps and glides off the helicopter. User can then use arrow controls from keyboard to maneuver the parachute towards the Carrier platform

1) Press Space bar: to jump off the platform
2) Press Arrow keys - move in respective direction and move towards Carrier platform
3) When Alice reaches Carrier platform, press Enter to make it land

See the attached video created using Alice 2.3 for 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.