enemy collisions

This commit is contained in:
ronny abraham 2024-09-11 15:42:46 +03:00
parent 063bcde7ac
commit f71a9875a0

40
ch01/lesson-12.org Normal file
View file

@ -0,0 +1,40 @@
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../../../_share/media/css/org-mode.css" />
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../_share/media/css/godot.css" />
#+title: Lesson 12: Player-Enemy Collisions
[[../../arpg/toc.org][< Back to Main TOC]]
* Notes
** add collision shape to enemy sprite
- add CollisionShape2D to sprite root
*** add shape
- select collision shape 2D node from Scene Panel
- Go to Inspector->CollisionShape2D->Shape
- select 'CapsuleShape2D' from dropdown
*** modify shape
- Go to Inspector->CollisionShape2D->Node2D
- Open 'Transform'
- Go to Rotation and set to 90 degrees
- Modify shape via handles to adjust it over sprite
*** z-index
- set :w
* Video Contents
[[https://www.youtube.com/watch?v=WVQkOWY3zxQ][Lesson Link]]
#+attr_html: :class content
- [[https://www.youtube.com/watch?v=WVQkOWY3zxQ][00:00 Introduction]]
- [[https://youtu.be/WVQkOWY3zxQ?si=vhyjv3xTfYhvAMmE&t=28][00:28 body-body collision]]
- [[https://youtu.be/WVQkOWY3zxQ?si=qLZquUVuAC-yYN1t&t=238][03:57 layer and mask]]
- [[https://youtu.be/WVQkOWY3zxQ?si=GqVUob9wQvm1YH_9&t=298][04:58 hurt boxy and hit box]]
- [[https://youtu.be/WVQkOWY3zxQ?si=rhqR5crCcWh7vgSH&t=394][06:34 hit box animation]]
- [[https://youtu.be/WVQkOWY3zxQ?si=DIBeG4TRZdhcds0g&t=711][11:51 fixing move animation]]
- [[https://youtu.be/WVQkOWY3zxQ?si=CTRznDX_bRokCO0d&t=751][12:31 hurt-hit box collisions]]
- [[https://youtu.be/WVQkOWY3zxQ?si=fUUy5KhrAFLzbWdA&t=827][13:47 outro]]