Sha256: 98bba96dd518a44c7afaea73c87565876b0e45793f523b6c6af064172bca42c2
Contents?: true
Size: 437 Bytes
Versions: 82
Compression:
Stored size: 437 Bytes
Contents
# -*- coding: utf-8 -*- require 'smalruby' car1 = Character.new(x: 0, y: 0, costume: 'car1.png') car2 = Character.new(x: 639, y: 0, costume: 'car2.png') car1.on(:start) do loop do move(5) if reach_wall? turn end end end car1.on(:hit, car2) do move_back(20) turn end car2.on(:start) do loop do move(10) if reach_wall? turn end end end car2.on(:hit, car1) do move_back(20) turn end
Version data entries
82 entries across 82 versions & 1 rubygems