Assignment 5: The Snake Game



Download 291.77 Kb.
View original pdf
Page1/7
Date10.03.2024
Size291.77 Kb.
#63800
  1   2   3   4   5   6   7
Assignment5-COMP1010-Fall2022
ComputerNetworks

ASSIGNMENT 5: Arrays (Units 1-19) DEPARTMENT AND COURSE NUMBER COMP 1010 COURSE TITLE Introduction to Computer Science 1 TERM Fall 2022 1
Assignment 5: The Snake Game

D
UE
D
ATE
:
M
ONDAY DECEMBER AT
11:59
PM
Submission Guidelines
• Name your sketch using your name and the assignment number, exactly as in this example
LastnameFirstnameA5. You will submit only one program in this assignment, for the
highest question completed.
• This assignment is broken into 7 questions (0 to 6). Hand in a working program for the last question you were able to complete. For example, if you finish Question 4, but Question 5 is not working, do not hand in Question 5. If it doesn't work you may not get all of the marks for Questions 1-4.
Hand in one pde file only. Do not hand in any other types of files.
• Your mark will largely depend on how many questions you were able to complete.
Please indicate clearly in the comments the highest question you were able to complete.
• Assignments must follow the programming standards document published on the course website on UM Learn.
• After the due date and time assignments maybe submitted but will lose 2% of marks per hour late or portion thereof. The date and time of the last file submitted controls the mark for the entire assignment.
• You may submit the assignment multiple times, but only the most recent version will be marked.
• These assignments are your chance to learn the material for the exams. Code your
assignments independently. We use software to compare all submitted assignments to each other, and pursue academic dishonestly vigorously.
The Snake Game
Background:
There have been many snake games with a similar concept
(
https://en.wikipedia.org/wiki/Snake_(video_game_genre)
). In this assignment you will create a simple game of this type. There is a snake (a line of green circles) which moves around the canvas, controlled by the keyboard. The J and A keys will make the snake turn left, and D and L will make it turn right. Since you control how it turns, not the direction it moves, this makes it tricky at first. The snake does not move smoothly. Instead, every few frames, anew circle is added to the head end, and the circle at the tail end disappears. There are some apples (red circles. When the snake eats an apple, the snake grows. It doesn’t grow instantly, but the circle at the tail will not disappear the next few times that the head moves. The snake

ASSIGNMENT 5: The Snake Game DEPARTMENT AND COURSE NUMBER COMP 1010 2 cannot go off the canvas, or bite itself, or the game is over. If the snake eats all of the apples, then anew level begins, where the snake is longer, moves faster, grows faster, and has more apples to eat.

Download 291.77 Kb.

Share with your friends:
  1   2   3   4   5   6   7




The database is protected by copyright ©ininet.org 2024
send message

    Main page