example.dd 496 B

123456789101112131415161718192021222324252627282930313233343536
  1. # main world
  2. struct world_main : dd_world {
  3. # test sprite
  4. struct dd_sprite my_sprite;
  5. # init sprite
  6. override void init() {
  7. # first sprite is at the top
  8. this.my_sprite.x = 100;
  9. this.my_sprite.y = 100;
  10. this.my_sprite.load("dd_logo.png");
  11. };
  12. # update sprite's position
  13. override void update() {
  14. myfunc2(x, z);
  15. }; # update
  16. # draw sprite
  17. override void draw() {
  18. this.my_sprite.draw();
  19. };
  20. void myfunc(int z, int b) {
  21. };
  22. }; # world_main
  23. void myfunc2(int v, int y) {};