It will an initial food position that is completely random. It will create a canvas of size 600圆00px. We have setUp () function that is called for the first time. Here we have made a Snake object who can of course move left, right, up, down and eat food. So, the basic structure is like this we have a used OOPs features like Objects. Implemented just basic functionality like keypress event, placing food on the grid and eating food. We have used P5JS javascript library for drawing 2D objects on the canvas.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |