Compare commits
10 commits
9cfd177142
...
56ee98f4e9
| Author | SHA1 | Date | |
|---|---|---|---|
| 56ee98f4e9 | |||
| 0c027bb783 | |||
| ff364c8680 | |||
| 38c2443185 | |||
| d8ec76c5f5 | |||
| 0bc1d9989a | |||
| fac2ed5af5 | |||
| 46f7e767d1 | |||
| 50d618bc4e | |||
| f5c9e58ddf |
13 changed files with 203 additions and 2 deletions
BIN
_share/media/img/albert/section04/lesson-07/E01.png
Normal file
BIN
_share/media/img/albert/section04/lesson-07/E01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
_share/media/img/section04/lesson04/EX04a.png
Normal file
BIN
_share/media/img/section04/lesson04/EX04a.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
_share/media/img/section04/lesson04/EX04b.png
Normal file
BIN
_share/media/img/section04/lesson04/EX04b.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
BIN
_share/media/img/section04/lesson04/EX04c.png
Normal file
BIN
_share/media/img/section04/lesson04/EX04c.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
BIN
_share/media/img/section04/lesson04/EX05.png
Normal file
BIN
_share/media/img/section04/lesson04/EX05.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
BIN
_share/media/img/section04/lesson04/EX06a.png
Normal file
BIN
_share/media/img/section04/lesson04/EX06a.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
|
|
@ -53,3 +53,47 @@
|
|||
|
||||
#+attr_html: :width 600px
|
||||
file:../../_share/media/img/section04/lesson04/EX03.png
|
||||
|
||||
**** frame duration
|
||||
- the frame duration textbox allows you to set the duration of a specific frame
|
||||
- this is apparently done by time
|
||||
|
||||
*** adding frames
|
||||
- click on the add frames button
|
||||
#+attr_html: :width 600px
|
||||
file:../../_share/media/img/section04/lesson04/EX04a.png
|
||||
|
||||
- add a sprite sheet
|
||||
- resize the sprite grid so godot can know what the sprites are
|
||||
#+attr_html: :width 600px
|
||||
file:../../_share/media/img/section04/lesson04/EX04b.png
|
||||
|
||||
- when you are satisfied with the frames available, select all and add the frames
|
||||
#+attr_html: :width 600px
|
||||
file:../../_share/media/img/section04/lesson04/EX04c.png
|
||||
|
||||
** resources
|
||||
- currently the sprite we created is embedded as an internal resource to our plane scene
|
||||
- if you save it, then the information regarding the frames will be moved to that tres file you saved
|
||||
- allows you to reuse the frame resource
|
||||
|
||||
*** saving the sprite frame as a resource
|
||||
- click on Inspector->AnimatedSprite2D->Animation->Sprite Frame drop down arrow
|
||||
- in the pop up menu click on 'save as'
|
||||
|
||||
#+attr_html: :width 300px
|
||||
file:../../_share/media/img/section04/lesson04/EX05.png
|
||||
|
||||
** NOTE: if the plane is too large (or small)
|
||||
- go to the plane scene
|
||||
- select the AnimatedSprite2D from the scene menu
|
||||
- go to Inspector->Node2D->Transform->Scale
|
||||
- change values as appropriate
|
||||
|
||||
** add the plane scene
|
||||
1. go to the game scene
|
||||
2. click on the 'instantiate child node'
|
||||
#+attr_html: :width 300px
|
||||
file:../../_share/media/img/section04/lesson04/EX06a.png
|
||||
|
||||
3. from dialog popup, select the plane.tscn scene
|
||||
|
|
|
|||
38
_subsections/sec04/lesson-05.org
Normal file
38
_subsections/sec04/lesson-05.org
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#+title: Section 04 - Lesson 05, 06 | collision shapes and resources, falling]
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../_share/media/css/godot.css" />
|
||||
#+OPTIONS: H:6
|
||||
|
||||
* Links
|
||||
- [[../../toc.org][TOC - Godot Notes]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/45069805#overview][S04:L50.05 - video]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/45069813#overview][S04:L51.06 - video]]
|
||||
|
||||
* Notes
|
||||
- we need a collisionshape to tell the physics engine the boundaries of this plane
|
||||
- add a child node CollisionShape2D to the CharacterBody2D root node of this scene
|
||||
- in the Inspector, click on Shape to determine what type of shape we are using
|
||||
|
||||
** create script for falling
|
||||
- hit the 'attach new or existing script' button on the upper right corner of the scene dialog
|
||||
- make sure that the script:
|
||||
- inherits from CharacterBody2D
|
||||
- the Template is 'Node Default'
|
||||
- Built in Script is OFF
|
||||
|
||||
*** script functions
|
||||
- ready() starts when node is set
|
||||
- process() is called every time a frame is called
|
||||
- NOTE: better to use physics_process because that's what the engine is going to use
|
||||
- so change process to physics process
|
||||
#+BEGIN_SRC gdscript
|
||||
_physics_process(delta: float) ->void:
|
||||
#+END_SRC
|
||||
|
||||
** CharacterBody2D
|
||||
*** properties
|
||||
**** velocity
|
||||
- has an 'x' and a 'y'
|
||||
|
||||
**** up_direction
|
||||
- tells physics engine how to know if we are on a floor or not
|
||||
- can tell us if we are on a ceiling or a wall
|
||||
31
_subsections/sec04/lesson-07.org
Normal file
31
_subsections/sec04/lesson-07.org
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#+title: Section 04 - Lesson 07 | Flying
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../_share/media/css/godot.css" />
|
||||
#+OPTIONS: H:6
|
||||
|
||||
* Links
|
||||
- [[../../toc.org][TOC - Godot Notes]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/45069815#overview][S04:L52.07 - video]]
|
||||
|
||||
* Notes
|
||||
** adding actions
|
||||
*** default
|
||||
1. Project->Project Settings
|
||||
2. click on Input Map tab
|
||||
3. check 'Show built-In Actions'
|
||||
|
||||
#+attr_html: :width 800
|
||||
file:../../_share/media/img/albert/section04/lesson-07/E01.png
|
||||
|
||||
*** custom
|
||||
1. make sure that 'Show built In Actions' is UNCHECKED
|
||||
2. in the 'add new action' textbox, add the name of your actions
|
||||
3. selec the action
|
||||
4. on the right side of the action line, click on the '+' symbol
|
||||
5. add the keystroke
|
||||
- click inside the textbox and hit the keystroke you want
|
||||
- in the lower part of the dialog select the actual input
|
||||
|
||||
** implementing
|
||||
- use the Input class as a Singleton
|
||||
- use Input.is_action_just_pressed bc actions get processed so fast
|
||||
- add the name of the action to the func call
|
||||
57
_subsections/sec04/lesson-08.org
Normal file
57
_subsections/sec04/lesson-08.org
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#+title:Flyin#+title: Section 04 - Lesson 08 | Collisions: Hitting the floor
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../_share/media/css/godot.css" />
|
||||
#+OPTIONS: H:6
|
||||
|
||||
* Links
|
||||
- [[../../toc.org][TOC - Godot Notes]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/45069817#overview][S04:L53.08 - video]]
|
||||
|
||||
* Notes
|
||||
|
||||
** when a character body2d hits the floor
|
||||
- velocity is set to 0
|
||||
- is_on_floor is set to true
|
||||
|
||||
** create a floor
|
||||
to create a floor we are going to use a StaticBody2D
|
||||
|
||||
|
||||
1. make this as a seperate scene
|
||||
2. add root node StaticBody2D
|
||||
3. add CollisionShape2D as child
|
||||
4. in collisionshape2D inspector go to shape and pick rectangle shape
|
||||
5. stretch the rectangle across the scene
|
||||
6. save scene
|
||||
|
||||
** add barrier to game
|
||||
1. add the barrier scene to the game scene
|
||||
2. put it at top of screen or whereever you like
|
||||
3. Ctrl+D to create another one and move it to the floor
|
||||
|
||||
** when plane hits floor stop it from moving
|
||||
- in physics process func check if 'in on floor'
|
||||
- if so than invoke die
|
||||
|
||||
#+BEGIN_SRC gdscript
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
# ...
|
||||
|
||||
if is_on_floor() == true:
|
||||
die()
|
||||
|
||||
func die() -> void:
|
||||
set_physics_process(false)
|
||||
#+end_src
|
||||
|
||||
** end properller animation
|
||||
- switch to plane scene
|
||||
- Cmd + drag AnimationSprite to script
|
||||
- in die set the variable to the sprite to 'stop()'
|
||||
|
||||
#+BEGIN_SRC gdscript
|
||||
func die() -> void:
|
||||
set_physics_process(false)
|
||||
animated_spirte_2d.stop()
|
||||
#+end_src
|
||||
9
_subsections/sec04/lesson-09.org
Normal file
9
_subsections/sec04/lesson-09.org
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#+title:Flyin#+title: Section 05 - Lesson 09 | Plane Movement
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../_share/media/css/godot.css" />
|
||||
#+OPTIONS: H:6
|
||||
|
||||
* Links
|
||||
- [[../../toc.org][TOC - Godot Notes]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/49010963#overview][S05:L06 - video]]
|
||||
|
||||
* Notes
|
||||
11
_subsections/sec05/lesson-06.org
Normal file
11
_subsections/sec05/lesson-06.org
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#+title:Flyin#+title: Section 05 - Lesson 09 | Plane Movement
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" hare/media/css/godot.css" />
|
||||
#+OPTIONS: H:6
|
||||
|
||||
* Links
|
||||
- [[../../toc.org][TOC - Godot Notes]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/49010963#overview][S05:L06 - video]]
|
||||
|
||||
* Notes
|
||||
- the more complex the collision shape the more computations
|
||||
- if you concentrate on good games, you'll notice the collisions are actually straightforward
|
||||
15
toc.org
15
toc.org
|
|
@ -1,14 +1,14 @@
|
|||
#+title: Jumpstart to 2D Game Development: Godot 4.3+ for Beginners
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="_share/media/css/godot.css" />
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="_share/media/css/org-media-sass/content-overview.css" />
|
||||
#+HTML_HEAD: <script src="_share/media/js/org-media-js/collapsible.js"></script>
|
||||
|
||||
* Links
|
||||
#+attr_html: :class links
|
||||
- [[../../../course-listings.org][Courses Listing]]
|
||||
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/45145347#overview][Godot2D Course]]
|
||||
|
||||
* Contents Overview
|
||||
|
||||
* obsolete
|
||||
** Section 3 - An intro to Godot with Gem Catcher
|
||||
#+attr_html: :class contents-overview
|
||||
- [[./_subsections/sec03/lesson-02.org][Lesson 02 | Game Scene]]
|
||||
|
|
@ -25,7 +25,18 @@
|
|||
- [[./_subsections/sec03/lesson-30.org][Lesson 30 | Section Review]]
|
||||
|
||||
** Section 4 - Tappy Plane!
|
||||
#+attr_html: :class contents-overview
|
||||
- [[./_subsections/sec04/lesson-01.org][Lesson 01 | Project Setup & Aspect Ratios]]
|
||||
- [[./_subsections/sec04/lesson-02.org][Lesson 02 | Project Assets & Imports]]
|
||||
- [[./_subsections/sec04/lesson-03.org][Lesson 03 | Physics 2D Nodes]]
|
||||
- [[./_subsections/sec04/lesson-04.org][Lesson 04 | Plane Scene and Resources]]
|
||||
- [[./_subsections/sec04/lesson-05.org][Lesson 05, 06 | Collision Shapes and Resources, Falling]]
|
||||
- [[./_subsections/sec04/lesson-07.org][Lesson 07 | Flying]]
|
||||
- [[./_subsections/sec04/lesson-08.org][Lesson 08 | Collisions: Hitting the Floor]]
|
||||
|
||||
* Contents Overview
|
||||
|
||||
** Section 5 - Tappy Plane!
|
||||
#+attr_html: :class contents-overview
|
||||
- [[./_subsections/sec05/lesson-06.org][Lesson 06 | Plane Movement]]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue