Hacktoberfest 2021

Hi!

The Hacktoberfest - an event where you can contribute to any open source or available for PRs project and get awesome rewards! - is coming and I would like to here from you, if you are planning any contributions and if so, it would be great to share them here when they are out! :wink:

P.S. The T-shirt from last year is still cool!

7 Likes

I always try to participate!

In previous years we’ve seen people contribute to the Defold documentation (translations) as part of Hacktoberfest. I also hope we can get some contributions for a couple of our official Defold extensions:

I’d also love to see the community contribute more examples for the Examples section of the Learn page. It would be really cool to have examples of more or less all of the Defold API functions.

Agreed! I think I have t-shirts from the last three or four years!

6 Likes

This is a very cool idea!

1 Like

Much toooooo big… but I like it. :rofl:

9 Likes

At first I created a very simple example with hinge joints - a cart! :partying_face:

Everything is already published here:

@britzl I hope you could still add defold/examples as a participating project?

7 Likes

Thanks for the example. I am wondering why the joint has to be destroyed and recreated when changing directions?

1 Like

This is probably a bug that I’m currently investigating. It should not be requried.

1 Like

Yes, I will update the example as soon as set will affect a currently created joint :wink:

It actually does work. Here’s from the example I shared earlier on Discord:

local FRONTWHEEL = "frontwheel#collisionobject"
local BACKWHEEL = "backwheel#collisionobject"
local BODY = "body#collisionobject"

local FRONT_ID = hash("frontwheel")
local BACK_ID = hash("backwheel")

local V3ZERO = vmath.vector3(0)


function init(self)
	local props = {
		motor_speed = 20,
		enable_limit = false,
		enable_motor = true,
		max_motor_torque = 100,
	}

	physics.create_joint(physics.JOINT_TYPE_HINGE, FRONTWHEEL, FRONT_ID, V3ZERO, BODY, vmath.vector3(40, -10, 0), props)
	physics.create_joint(physics.JOINT_TYPE_HINGE, BACKWHEEL, BACK_ID, V3ZERO, BODY, vmath.vector3(-40, -10, 0), props)

	timer.delay(2, false, function()
		local props = {
			motor_speed = -20,
			enable_limit = false,
			enable_motor = true,
			max_motor_torque = 100,
		}
		physics.set_joint_properties(FRONTWHEEL, FRONT_ID, props)
		physics.set_joint_properties(BACKWHEEL, BACK_ID, props)
	end)
end

The problem was that I had the motor torque set too low and the initial speed too high. With a higher torque the direction of movement changes as expected.

3 Likes

Thank you so much! I checked it and it works as expected, a great lesson :wink: I made a PR with improvements :slight_smile:

4 Likes

As a second task for this Hacktoberfest I continue translating Defold manuals, this time message passing (though it is still not visible on the Defold website) :wink:

Ah, approved but not merged! It will be available soon!

1 Like

@Pawel Inspired by this post and your great Joint Physics example, I decided to give it a go and submitted an example on panning sound. Now the example is up on the site. :slight_smile: cheers~

6 Likes

A great example @MasterMind! Perfectly shows the usage of panning :slight_smile:

I made two further challenges:

I continue translating docs to Polish, made a PR with translations of importing assets, graphics and models :wink:

Also I created another example! It’s in verification now and it’s about animating cursor value of the sprite:

5 Likes

Hmm, the gif recorder is way lower than 60 FPS

Edit: But it’s live now, you can check it out :wink:

1 Like

Any ideas for further examples? :wink:

Perhaps examples of other joint types?

4 Likes

Here it is!

Fixed joint for rope simulation and spring joint for resilient rope simulation :wink:
And additionally a changing gravity!

PR is pending so, soon it iwll be on the website :wink:

6 Likes