// This program demonstrates the Gel objects.
//
// A Sprite and a Bob is treated as objects with certain
// member functions such as Create, Delete and Move.
//
// The immage data is placed in DATA statements in a user
// defined object that inherits properties (in several steps)
// from other Gel objects.

USE GelObject

DIM MySprite1 OF VirtualSprite
DIM MyBob1 OF Bob
DIM MySprite2 OF VirtualSprite
DIM MyBob2 OF Bob

MySprite1.Create
MySprite1.Draw(100,50)
MyBob1.Create
MyBob1.Draw(110,150)
MySprite2.Create
MySprite2.Draw(500,50)
MyBob2.Create
MyBob2.Draw(490,150)

t$:=INKEY$(2)

LOOP 100 TIMES
  MySprite1.Move(4,1)
  MyBob1.Move(4,-1)
  MySprite2.Move(-4,1)
  MyBob2.Move(-4,-1)
ENDLOOP

t$:=INKEY$(5)

MySprite1.Delete
MyBob1.Delete
MySprite2.Delete
MyBob2.Delete


STRUC VirtualSprite
  INHERIT VSpriteObject

  PROC Create
    Init
  ENDPROC Create

  // Colors
  DATA $0F00,$00F0,$000F

  // Sprite data
  DATA 12                                   // number of lines
  DATA %1111111111111111,%1111111111111111  // 1. line
  DATA %1111111111111111,%1100000000000011
  DATA %1111111111111111,%1100000000000011
  DATA %1111000000001111,%1100111111110011
  DATA %1111000000001111,%1100111111110011
  DATA %1111000000001111,%1100110011110011
  DATA %1111000000001111,%1100110011110011
  DATA %1111000000001111,%1100111111110011
  DATA %1111000000001111,%1100111111110011
  DATA %1111111111111111,%1100000000000011
  DATA %1111111111111111,%1100000000000011
  DATA %1111111111111111,%1111111111111111  // 12. line

ENDSTRUC VirtualSprite

STRUC Bob
  INHERIT BobObject

  PROC Create
    Init
  ENDPROC Create

  // Bob data
  DATA 1,9     // Words per line and number of lines

  // Plane 0
  DATA %0000111111000011   // 1. line
  DATA %0011111111110011
  DATA %0011000011000011
  DATA %0000000000000000
  DATA %0000000000000000
  DATA %0000000000000000
  DATA %1100000000110011
  DATA %1111111111000000
  DATA %0011111100000011   // 9. line

  // Plane 1
  DATA %0000000000000000   // 1. line
  DATA %0000000000000000
  DATA %0000000000000000
  DATA %0011110000000011
  DATA %0011111111000011
  DATA %0000001111000011
  DATA %1100000000110011
  DATA %1111111111000000
  DATA %0011111100000011   // 9. line

ENDSTRUC Bob
