Zum Inhalt springen

Vortrag

Nostalgia Meets Technology: Super Mario with TypeScript

BASTA!von Manfred Steyer

Folien zum Vortrag (33)

  1. Folie 1 von 33: Nostalgia Meets Technology
  2. Folie 2 von 33
  3. Folie 3 von 33: Why?
  4. Folie 4 von 33: Agenda
  5. Folie 5 von 33: About
  6. Folie 6 von 33: DEMO
  7. Folie 7 von 33: Loading
  8. Folie 8 von 33: Game Loop
  9. Folie 9 von 33: A
  10. Folie 10 von 33: A
  11. Folie 11 von 33: A
  12. Folie 12 von 33: A
  13. Folie 13 von 33: A
  14. Folie 14 von 33: DEMO
  15. Folie 15 von 33: Tiles & Coordinates
  16. Folie 16 von 33: (Cols,
  17. Folie 17 von 33: GameGrid
  18. Folie 18 von 33: Gravity
  19. Folie 19 von 33
  20. Folie 20 von 33: Idea
  21. Folie 21 von 33: DEMO
  22. Folie 22 von 33: Side Scrolling & View Port
  23. Folie 23 von 33: Scroll Offset
  24. Folie 24 von 33: DEMO
  25. Folie 25 von 33: Collision Detection
  26. Folie 26 von 33: Bounding
  27. Folie 27 von 33: First,
  28. Folie 28 von 33: First,
  29. Folie 29 von 33: Bounding
  30. Folie 30 von 33: DEMO
  31. Folie 31 von 33: Modern
  32. Folie 32 von 33: Conclusion
  33. Folie 33 von 33: Manfred Steyer
Folientext (alle Folien)
  1. Nostalgia Meets Technology Super Mario with TypeScript ANGULARarchitects.io
  2. –
  3. Why? 1) Just for Fun! 2) Learning/ Repeating Typical Patterns Exercise 3) •Nice Programming
  4. Agenda 1) Game Loop 2) Tiles & Coordinates 3) •Gravity 4) Side Scrolling & View Port 5) Collision Detection
  5. About Me Manfred Steyer, ANGULARarchitects.io (Remote) Angular Workshops and Consulting Google Developer Expert for Angular Blog, Books, Articles, and Talks about Angular
  6. DEMO
  7. Loading Images bearbeiten const response = await fetch('/hero.png'); const blob = await response.blob(); •const heroTile = await createImageBitmap( blob, 0, // x 8, // y 16, // width 16 // height );
  8. Game Loop
  9. A Simple Game Loop function tick(ctx: HeroContext, timeStamp: number): void { •[…]Textmasterformat bearbeiten }
  10. A Simple Game Loop function tick(ctx: HeroContext, timeStamp: number): void { timeStamp); •console.log('timeStamp', […] }
  11. A Simple Game Loop function tick(ctx: HeroContext, timeStamp: number): void { timeStamp); •console.log('timeStamp', if (keyboard.right) { ctx.x += 1; } […] }
  12. A Simple Game Loop function tick(ctx: HeroContext, timeStamp: number): void { timeStamp); •console.log('timeStamp', if (keyboard.right) { ctx.x += 1; } ctx.context.clearRect(0, 0, 1000, 1000); ctx.context.drawImage(ctx.heroTile, ctx.x, ctx.y, 16, 16); […] }
  13. A Simple Game Loop function tick(ctx: HeroContext, timeStamp: number): void { timeStamp); •console.log('timeStamp', if (keyboard.right) { ctx.x += 1; } ctx.context.clearRect(0, 0, 1000, 1000); ctx.context.drawImage(ctx.heroTile, ctx.x, ctx.y, 16, 16); requestAnimationFrame((timeStamp) => tick(ctx, timeStamp)); }
  14. DEMO
  15. Tiles & Coordinates
  16. (Cols, Rows) vs. (x,bearbeiten y)
  17. GameGrid gameGrid[0][0] = { tile: skyTile }; gameGrid[1][0] = { tile: skyTile }; •[…]Textmasterformat bearbeiten
  18. Gravity
  19. –
  20. Idea WHILE not at ground Increase y by velocity Increase velocity
  21. DEMO
  22. Side Scrolling & View Port
  23. Scroll Offset View Port x - renderX renderX x Scroll Offset + View Port Width
  24. DEMO
  25. Collision Detection
  26. Bounding Boxes bearbeiten
  27. First, in 1D < <
  28. First, in 1D < <
  29. Bounding Boxes bearbeiten a b a.left < b.right b.left < a.right a.top < b.bottom b.top < a.bottom
  30. DEMO
  31. Modern Angular bearbeiten Architecture, Concepts, Implementation 400+ pages, PDF, EPUB Regular Free Updates! Q1/2026 Waiting List: angular-book.com
  32. Conclusion 1) Game Loop: Take Care of Time Delta 2) Tiles & Coordinates ZweiteIncrease/ Ebene Decrease Velocity 3) •Gravity: 4) Side Scrolling & View Port: Change Offset i/o Hero Coordinates 5) Collision Detection: Bounding Boxes 6) We had fun!
  33. Manfred Steyer [Social Media] Manfred Steyer [web] ANGULARarchitects.io Slides, Examples, Book Remote Company Workshops and Consulting http://angulararchitects.io @ Manfred Steyer

Buchtipp

Modern Angular

Architecture, Concepts, Implementation: practical guidance for modern Angular – Signals, Signal Forms, the NgRx Signal Store, AI and architecture.

Mehr zum Buch: Modern Angular (öffnet in neuem Fenster)