Lawnmower

Upload your latest creations here, and download the latest creations here! This is where the creative tool shop resides.
Post Reply
Dr. Madskull
Posts: 20
Joined: Tue Jun 04, 2019 11:35 am

Lawnmower

Post by Dr. Madskull » Wed Aug 07, 2019 1:18 pm

This is a lawnmower cutting the grass!

There are some bushes spread out over the garden, acting as obstacles, and the screen border is the border of the garden.
The lawnmower itself is the actual experiment; I try to mimic a real autonomous lawnmower, with its limited ways of detecting its surroundings. It has two sensors, one at each side of the mower. They simply detect the reddish colour of the bushes, and they detect the borders of the screen. When they do so, the mower stops, back up, rotate, and start forward again.
That's it. There are just about a million different tweaks possible to do in the code, so go ahead! :D

Code is based on the yoss_controlling_framerate.js, so take a look at that piece of code first if you find this code massive and hard to understand.
Attachments
yoss_lawnmower.js
(18.44 KiB) Downloaded 535 times

Post Reply