not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.2 KiB

  1. 
  2. // Credit screen class
  3. enyo.kind({
  4. name: "FoodChain.Credits",
  5. kind: enyo.Control,
  6. classes: "board credits-popup",
  7. components: [
  8. { kind: "Scroller", classes: "credit-content", components: [
  9. { classes: "two-column-credits", components: [
  10. { name: "concept", classes: "credit-title" },
  11. { content: "Lionel Laské", classes: "credit-name" },
  12. { name: "arts", classes: "credit-title" },
  13. { content: "Art4Apps (learn & build game)", classes: "credit-name" },
  14. { content: "Vicki Wenderlich (play game)", classes: "credit-name" },
  15. { content: "Mathafix (icon)", classes: "credit-name" },
  16. { content: "Ray Larabie (home font)", classes: "credit-name" },
  17. { name: "music", classes: "credit-title" },
  18. { content: "part of Popcorn by Gershon Kingsley", classes: "credit-name" },
  19. { name: "sound", classes: "credit-title" },
  20. { content: "Charel Sytze (applause)", classes: "credit-name" },
  21. { content: "Unchaz (disappointment)", classes: "credit-name" },
  22. { content: "Esformouse (frog)", classes: "credit-name" },
  23. { content: "Galeky (flyes)", classes: "credit-name" },
  24. { content: "Novino (snake)", classes: "credit-name" }
  25. ]},
  26. {kind: "Canvas", name: "canvas", classes: "emul-canvas", attributes: {width: 300, height: 600}}
  27. ]},
  28. { name: "home", kind: "ShadowButton", img: "home", classes: "home", ontap: "home" },
  29. // Preload iamges
  30. {kind: "Image", id: "frog4", src:"images/frog4.png", classes: "image-preload", onload: "initCanvas" },
  31. {kind: "Image", id: "fly1", src:"images/fly1.png", classes: "image-preload" },
  32. {kind: "Image", id: "snake4", src:"images/snake4.png", classes: "image-preload" },
  33. // End of sound event
  34. {kind: "Signals", onEndOfSound: "endOfSound"}
  35. ],
  36. // Constructor, save home
  37. create: function() {
  38. this.inherited(arguments);
  39. this.setLocale();
  40. // Init soundtrack
  41. this.soundtrack = "audio/popcorn";
  42. },
  43. // Localization changed, update string resource
  44. setLocale: function() {
  45. this.$.concept.setContent(__$FC("concept"));
  46. this.$.arts.setContent(__$FC("arts"));
  47. this.$.music.setContent(__$FC("music"));
  48. this.$.sound.setContent(__$FC("sound"));
  49. },
  50. // Image loaded, display elements of play game
  51. initCanvas: function() {
  52. this.ctx = this.$.canvas.node.getContext('2d');
  53. var zoom = FoodChain.getZoomLevel();
  54. this.$.canvas.hasNode().style.MozTransform = "scale("+zoom+")";
  55. this.$.canvas.hasNode().style.MozTransformOrigin = "0 0";
  56. this.$.canvas.hasNode().style.zoom = zoom;
  57. this.ctx.clearRect(0, 0, this.$.canvas.attributes.width, this.$.canvas.attributes.height);
  58. var fly = new Sprite({x: 150, y: 50, heading: 0, images: ["fly1"], width: 58, height: 86, index: 0});
  59. fly.draw(this.ctx);
  60. var frog = new Sprite({x: 150, y: 200, heading: 90, images: ["frog4"], width: 116, height: 172, index: 0});
  61. frog.draw(this.ctx);
  62. var snake = new Sprite({x: 150, y: 450, heading: 90, images: ["snake4"], width: 100, height: 250, index: 0});
  63. snake.draw(this.ctx);
  64. },
  65. // Loop on the theme
  66. endOfSound: function(e, s) {
  67. if (s.sound == this.soundtrack)
  68. FoodChain.sound.play(this.soundtrack);
  69. },
  70. // Go to the home page of the app
  71. home: function() {
  72. FoodChain.goHome();
  73. }
  74. });