In this part, we are creating a cannon that shoot cannon balls.
There will be a lot of tips and tricks – hope you will find some of them useful.
The goal of this tutorial series is to show you how you can create your own cannon (gun) that shoot cannon balls (bullets), while handling your own physics, adding animation, and interacting between bullets and enemies, letting enemies take damage and update their own health bar.
00:05 – What we aim to get out of this tutorial series
00:34 – Previewing the end result (approx.)
02:23 – Creating our Main Scene
02:48 – Creating our Cannon Scene
03:24 – Why we use the .tscn format
03:44 – Importing and adding Sprite
04:43 – Adding CollisionPolygon2D
06:05 – Starting with our Cannon Script
06:56 – Explaining ‘export’ in GDScript
07:08 – Creating the Cannon Ball (Bullet) Scene
09:28 – Bug in the FileSystem
10:39 – Back to the Cannon Script
12:52 – Why we should add bullet to parent
16:19 – Creating our first setget function
20:36 – Adding Input event checks
22:58 – Adding a forced delay between bullets
28:23 – Important to note when editing instances(…)
28:56 – Testing our scene
29:18 – Adding a Rapid Fire function
29:44 – Disable collision between cannon and balls
31:30 – Wrapping up for this part
Assets ►!ER1iDb6S!-t5Khe-4MrBA-3T73kBBc3alGFU0H8iTEXWs6791RV0
Project Files ►!gAlxHSJL!osje0EdtOM5CQPBgxNj_oTW-0YrLoqfE9by0nCoDoJ4
Contact Information:
Web-Site ►
Twitter ►
GitHub ►
Background music provided by Teknoaxe: