• KJ Ha

Nature of Code: 5th Assignment

Code: https://editor.p5js.org/kh1785/sketches/_YHzwobV8

For this week's assignment, I've created a simple game using autonomous agents.

The rules of the game are simple.

At first, five lives are given. The vehicle takes the red dot as a target, and as the vehicle touches the red dot, the player loses one life. All the player needs to do is to make the red dot run away from the vehicle using their mouse as represented by the blue dot.

There are two occasions to make the red dot move to a random location. The first occasion is when the player lost one life. This is the moment when the vehicle touches the red dot. The second occasion is when the blue dot approaches the red dot.

Therefore, the objective of this game is to make the blue dot reach the red dot faster than the vehicle so the red dot can stay alive longer as possible.

Live Demo:

Recent Posts

See All

Nature of Code: 6th Assignment

Link to code: https://editor.p5js.org/kh1785/sketches/tT1Cj0ZRp9 For this week's assignment, I've created a sketch inspired by one of the video examples, the Game of Life. A lot was taken directly fro

Mid-Semester Exercise

Link to code: https://editor.p5js.org/kh1785/sketches/6ADFot4NQ Live sketch: For the mid-semester project, I’ve decided to further develop the week 3 assignment, a p5 sketch simulating a helium-filled

© 2020 Kyungjoo Ha. All Rights Reserved