HelloPolycodeApp.cpp 786 B

12345678910111213141516171819202122232425262728
  1. #include "HelloPolycodeApp.h"
  2. HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
  3. core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
  4. PhysicsScreen *screen = new PhysicsScreen(10, 60);
  5. ScreenShape *shape = new ScreenShape(ScreenShape::SHAPE_RECT, 600,30);
  6. shape->setColor(0.0,0.0,0.0,1.0);
  7. shape->setPosition(640/2, 400);
  8. screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, true);
  9. for(int i=0; i < 200; i++) {
  10. shape = new ScreenShape(ScreenShape::SHAPE_RECT, 20,5);
  11. shape->setRotation(rand() % 360);
  12. shape->setPosition(rand() % 640, rand() % 300);
  13. screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);
  14. }
  15. }
  16. HelloPolycodeApp::~HelloPolycodeApp() {
  17. }
  18. bool HelloPolycodeApp::Update() {
  19. return core->Update();
  20. }