Sha256: dff69cde23bba19a70f1f3bd85353040bd09559ed13e91c0cf249dd3fa0fc4f1

Contents?: true

Size: 436 Bytes

Versions: 10

Compression:

Stored size: 436 Bytes

Contents

#
# PolygonPShapeOOP. 
# 
# Wrapping a PShape inside a custom class 
#/

load_library 'star'
# A Star object
attr_reader :s1, :s2

def setup
  size(640, 360, P2D)
  # Make a new Star
  @s1 = Star.new width, height
  @s2 = Star.new width, height
end

def draw
  background(51)
 
  s1.display # Display the first star
  s1.move    # Move the first star
  
  s2.display # Display the second star
  s2.move    # Move the second star

end


Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.6.2 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.6.1 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.6.0 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.5.1 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.5.0 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.4.4 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.4.3 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.4.2 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb
ruby-processing-2.4.1 samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb