Unfolding Gamedev - video tutorial series

Thank you so much @jbousquie ! :heart_eyes:

I bought a new microphone! :microphone: On this occasion I made a little bit less serious video about Story of Defold (actually it was in production for way too long, but now I recorded a crisp voiceover, so let me know if the difference is for better or worse :smiley: )

14 Likes

Great video! Thank you for sharing!

1 Like

Dope. Looking forward to this!

1 Like

Excellent video :smiley:
and the sound from the new mic is really good (I’m ready for watching/listening to new tutos :wink: )

As a Defold beginner user, I like learning about the people of the community, the project history and the way it was leaded until now.

2 Likes

Part 5! ParticleFX and Sounds! :notes:

But not only this - I tried to explain shenaningas with compensation functionality for platformer from the part 4 here better. Let me know if this is now more clear :wink:

11 Likes

Very clear explanation about collision compensation.
An excellent global work, as usual :smiley:

1 Like

Part 6 - after huge delay - is finally up! :partying_face:

Cameras for beginners explained: :movie_camera:

12 Likes

I’m trying to get back into Defold after a hiatus and I’m going through your tutorials. Overall, I think they are good, though you do go a bit fast at times. I’m currently stuck on Part 3 going over velocity (timestamp 9:50). I’ve gone through and rechecked my code against that in the video at least a dozen times and they are the same, as far as I can tell. However, when I run my game, the player instantly starts moving to the left, which makes sense to me because the code sets the position to increase by self.velocity in the update function, which is called constantly, as I understand it. Yet, in the video, the player only moves when given input. What am I missing?

My code is below. The only difference should be I named my action_id “move_right” instead of “right”.

local DIRECTION_RIGHT = 1
local DIRECTION_LEFT = -1
local BASE_VELOCITY = 500

function init(self)
msg.post("#", “acquire_input_focus”) – tell this component to acquire input focus

self.velocity = vmath.vector3(0, 0, 0)

end

function walk(self)
self.velocity.x = BASE_VELOCITY * self.direction
end

function flip(direction)
sprite.set_hflip("#sprite", direction < 0)
end

function animate(action)
if action.pressed then
sprite.play_flipbook("#sprite", “run”)
elseif action.released then
sprite.play_flipbook("#sprite", “idle”)
end
end

function fixed_update(self, dt)
local position = go.get_position() – get current game object’s position
position = position + self.velocity * dt
go.set_position(position) – set the position to the current game object
end

function on_input(self, action_id, action)
animate(action)
self.direction = (action_id == hash(“move_right”)) and DIRECTION_RIGHT or DIRECTION_LEFT
walk(self)
flip(self.direction)
end

1 Like

You probably need to re-set the volatile state at the end of the update loop:

self.velocity = vmath.vector3(0, 0, 0)
1 Like

I’m not sure what that means.

EDIT: Ahh, you mean continue with the video to the very next thing. Well, that didn’t work, it still runs off the screen as soon as it loads.

The summary video of features and improvements added in 2023 to Defold is here! :partying_face:

16 Likes

Great video, Pawel!
It’s hard for me to keep up with all the patches and versions changes. But this video really helped me to see how much was done last year. Also, good job, Defold team.

4 Likes

This time a summary of activities arlund Defold Community! :heart:

9 Likes