Zum Inhalt springen

Vortrag

Nostalgia Meets Technology: Super Mario with TypeScript

DWX 2026von Manfred Steyer

Folien zum Vortrag (32)

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

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)