User Tools

Site Tools


godot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
godot [2024/03/18 13:00]
admin
godot [2024/04/08 19:33] (current)
admin
Line 1: Line 1:
 ====== Getting Started with Godot ====== ====== Getting Started with Godot ======
 +This event runs monthly on the **2nd Monday** of the month. ​ See the [[start|home page]] for the date of our next monthly event.
  
 For our regular monthly tutorial nights, we're basing our teaching on the wonderful series by [[https://​www.youtube.com/​@AJsLearningLab|AJ'​s Learning Lab]], [[https://​www.youtube.com/​playlist?​list=PL4vjw0qHwNZIQZScBFaON0WGkz-BMyoCh|Godot FPS Tutorial - Learn Godot by making Wolfenstein 3D]]. For our regular monthly tutorial nights, we're basing our teaching on the wonderful series by [[https://​www.youtube.com/​@AJsLearningLab|AJ'​s Learning Lab]], [[https://​www.youtube.com/​playlist?​list=PL4vjw0qHwNZIQZScBFaON0WGkz-BMyoCh|Godot FPS Tutorial - Learn Godot by making Wolfenstein 3D]].
Line 42: Line 43:
   * In the world scene, drag the player scene into the world   * In the world scene, drag the player scene into the world
   * In the three dot menu (world scene), use 'Add Sun to scene',​ 'add environment to scene'   * In the three dot menu (world scene), use 'Add Sun to scene',​ 'add environment to scene'
-  * In the player scene, use the Mesh button to add a '​Simplified ​Convext ​Collision Sibling'​ mesh to the player'​s MeshInstance3D+  * In the player scene, use the Mesh button to add a '​Simplified ​Convex ​Collision Sibling'​ mesh to the player'​s MeshInstance3D ​(not '​Single',​ that'​ll cause performance issues - why?)
   * Set up WASD controls in the Project Settings   * Set up WASD controls in the Project Settings
  
Line 131: Line 132:
 if Global.current_weapon != "​knife"​ and Global.ammo <= 0: if Global.current_weapon != "​knife"​ and Global.ammo <= 0:
   Global.current_weapon = "​knife"​   Global.current_weapon = "​knife"​
-  $AnimatedSprite2D.player("​knife_idle"​)+  $AnimatedSprite2D.play("​knife_idle"​)
 </​code>​ </​code>​
   * Tweak first if statement, change to:   * Tweak first if statement, change to:
Line 344: Line 345:
 **Goal: Ammo pickups** **Goal: Ammo pickups**
  
 +
 +===== Next Steps =====
 +**Goal: Add sound effects**
 +  * Import the sound effect files (gun.ogg, machine.ogg,​ mini.ogg)
 +  * In the player scene, add a new node, AudioStreamPlayer.
 +  * Add the following code to the player shoot() function:
 +<​code>​
 +var sound_player = $AudioStreamPlayer
 +match Global.current_weapon:​
 +  "​gun":​
 +    sound_player.stream = preload("​res://​gun.ogg"​)
 +  "​machine":​
 +    sound_player.stream = preload("​res://​machine.ogg"​)
 +  "​mini":​
 +    sound_player.stream = preload("​res://​mini.ogg"​)
 +sound_player.play()
 +</​code>​
godot.1710766836.txt.gz ยท Last modified: 2024/03/18 13:00 by admin