It seems this page is no longer available https://coronalabs.com/blog/guides-and-tutorials/can-i-jump-sticky-projectiles-wind-tunnels/.
Any chance we can get that wind tutorial reposted? Or if anyone knows where I could get my hands on the code?
It seems this page is no longer available https://coronalabs.com/blog/guides-and-tutorials/can-i-jump-sticky-projectiles-wind-tunnels/.
Any chance we can get that wind tutorial reposted? Or if anyone knows where I could get my hands on the code?
Just working off the name of it, are you looking to figure out how to have things pushed along as if in a wind tunnel (as opposed to something involving sticking projectiles as well)?
I’m checking into what will be needed to bring it back.
Rob
@ Rob, as a FYI, I use the forums a LOT for looking for solutions before posting. I run into this error a lot especially if they refer to an old blog post. The revamp appeared to have broken some of these. If theres a manual way to find it I’m game. 
Hi Graham, we appreciate the feedback.
Just a couple of items that the community might not be aware of with regards to old tutorials. First we have intentionally removed a bunch of older posts (not just tutorial) that were factually out of date. For some, we will bring them back in time if the content makes sense, but an old post on how to do something with Storyboard won’t be returning. This impacts tutorials based on Graphics 1.0. If we find a case where that’s important, we can try to resurrect them.
Secondly, we are trying to move tutorials out of the blog. The primary reason for this is as we do site redesigns, the tools that format code have changed (several times depending on the age of the plugin). The issue is that the code in the tutorials gets messed up and in some cases so messed up it’s hard to read. Ironically “The value of well formatted code” was one that got messed up. There are other reasons too (mostly all code formatting related) that makes doing tutorials in the blogs a long term problem.
It’s going to take time for us to migrate tutorials from the blog to our documentation system. Obviously we don’t want to loose anything useful but it’s not good to give you something broken either. We ask that you be patient as we migrate these tutorials. I’ve already asked about getting this particular tutorial migrated.
Rob
Hi @kevinlboehme,
As Rob said, many of the former tutorials which were “lost” will be converted over, but not all of them. Some of them were simply too outdated to bother with, or discussed topics which have since become pointless for modern app developers.
Already, we have a solid start on this, and many have been both converted and updated/enhanced. For instance, there was an old tutorial on creating a “countdown timer” which I just brought back and expanded upon considerably to discuss ways to deal with visual alignment issues that were problematic in the original version:
https://docs.coronalabs.com/tutorial/games/countdownTimer/index.html
Anyway, I didn’t think the “wind tunnel” one was that popular, but I’ll add it to my list to bring back. In the meantime, the “basic code” is below… but as I look at this years later, I actually would prefer to improve it (so I advise you use it at your own risk).
[lua]
local vent1 = display.newRect( 0, 0, 80, 300 )
physics.addBody(vent1, “kinematic”, { isSensor=true } )
vent1.isVent = true ; vent1.rotation = 14 ; vent1.x = 432 ; vent1.y = 660
vent1.xF, vent1.yF = getVentVals( vent1.rotation, 160 )
function getVentVals( angle, power )
local xF = math.cos( (angle-90)*(math.pi/180) ) * power
local yF = math.sin( (angle-90)*(math.pi/180) ) * power
return xF,yF
end
function ventCollide( self,event )
local vent = event.other
if ( event.phase == “began” and vent.isVent == true ) then
self.xF = self.xF+vent.xF ; self.yF = self.yF+vent.yF
Runtime:addEventListener( “enterFrame”, constantForce )
elseif ( event.phase == “ended” and vent.isVent == true ) then
self.xF = self.xF-vent.xF ; self.yF = self.yF-vent.yF
Runtime:removeEventListener( “enterFrame”, constantForce )
end
end
leaf1.collision = ventCollide ; leaf1:addEventListener( “collision”, leaf1 )
function constantForce()
if not ( leaf1.xF == 0 and leaf1.yF == 0 ) then
leaf1:applyForce( leaf1.xF, leaf1.yF, leaf1.x, leaf1.y )
end
end
[/lua]
Brent
This is great. Thanks for the response!
I use part of that code also in my game.
You already know how to modify it? Or at least what could not go?
Hi @jake1987.jj,
The basic code looks fine and has held up pretty well since I wrote it about 5 years ago. I’d just like to clean it up somewhat. Primarily, re-organize it so that everything is local (not global) and scoped properly for non-global usage.
Also, this code probably would cause issues if your object (character, whatever) was a multi-element physics body, since a collision would be registered for each element that intersected the vent bounds, making forces multiply in ways that aren’t intended.
Brent
Thanks @Brent Sorrentino.
I had noticed something strange with multi elements but fortunately I did not use them. For the global I’ve made some changes.
Thanks for the explanations. I Take a look at the new code when you rate it for personal curiosity
Just working off the name of it, are you looking to figure out how to have things pushed along as if in a wind tunnel (as opposed to something involving sticking projectiles as well)?
I’m checking into what will be needed to bring it back.
Rob
@ Rob, as a FYI, I use the forums a LOT for looking for solutions before posting. I run into this error a lot especially if they refer to an old blog post. The revamp appeared to have broken some of these. If theres a manual way to find it I’m game. 
Hi Graham, we appreciate the feedback.
Just a couple of items that the community might not be aware of with regards to old tutorials. First we have intentionally removed a bunch of older posts (not just tutorial) that were factually out of date. For some, we will bring them back in time if the content makes sense, but an old post on how to do something with Storyboard won’t be returning. This impacts tutorials based on Graphics 1.0. If we find a case where that’s important, we can try to resurrect them.
Secondly, we are trying to move tutorials out of the blog. The primary reason for this is as we do site redesigns, the tools that format code have changed (several times depending on the age of the plugin). The issue is that the code in the tutorials gets messed up and in some cases so messed up it’s hard to read. Ironically “The value of well formatted code” was one that got messed up. There are other reasons too (mostly all code formatting related) that makes doing tutorials in the blogs a long term problem.
It’s going to take time for us to migrate tutorials from the blog to our documentation system. Obviously we don’t want to loose anything useful but it’s not good to give you something broken either. We ask that you be patient as we migrate these tutorials. I’ve already asked about getting this particular tutorial migrated.
Rob
Hi @kevinlboehme,
As Rob said, many of the former tutorials which were “lost” will be converted over, but not all of them. Some of them were simply too outdated to bother with, or discussed topics which have since become pointless for modern app developers.
Already, we have a solid start on this, and many have been both converted and updated/enhanced. For instance, there was an old tutorial on creating a “countdown timer” which I just brought back and expanded upon considerably to discuss ways to deal with visual alignment issues that were problematic in the original version:
https://docs.coronalabs.com/tutorial/games/countdownTimer/index.html
Anyway, I didn’t think the “wind tunnel” one was that popular, but I’ll add it to my list to bring back. In the meantime, the “basic code” is below… but as I look at this years later, I actually would prefer to improve it (so I advise you use it at your own risk).
[lua]
local vent1 = display.newRect( 0, 0, 80, 300 )
physics.addBody(vent1, “kinematic”, { isSensor=true } )
vent1.isVent = true ; vent1.rotation = 14 ; vent1.x = 432 ; vent1.y = 660
vent1.xF, vent1.yF = getVentVals( vent1.rotation, 160 )
function getVentVals( angle, power )
local xF = math.cos( (angle-90)*(math.pi/180) ) * power
local yF = math.sin( (angle-90)*(math.pi/180) ) * power
return xF,yF
end
function ventCollide( self,event )
local vent = event.other
if ( event.phase == “began” and vent.isVent == true ) then
self.xF = self.xF+vent.xF ; self.yF = self.yF+vent.yF
Runtime:addEventListener( “enterFrame”, constantForce )
elseif ( event.phase == “ended” and vent.isVent == true ) then
self.xF = self.xF-vent.xF ; self.yF = self.yF-vent.yF
Runtime:removeEventListener( “enterFrame”, constantForce )
end
end
leaf1.collision = ventCollide ; leaf1:addEventListener( “collision”, leaf1 )
function constantForce()
if not ( leaf1.xF == 0 and leaf1.yF == 0 ) then
leaf1:applyForce( leaf1.xF, leaf1.yF, leaf1.x, leaf1.y )
end
end
[/lua]
Brent
This is great. Thanks for the response!
I use part of that code also in my game.
You already know how to modify it? Or at least what could not go?
Hi @jake1987.jj,
The basic code looks fine and has held up pretty well since I wrote it about 5 years ago. I’d just like to clean it up somewhat. Primarily, re-organize it so that everything is local (not global) and scoped properly for non-global usage.
Also, this code probably would cause issues if your object (character, whatever) was a multi-element physics body, since a collision would be registered for each element that intersected the vent bounds, making forces multiply in ways that aren’t intended.
Brent
Thanks @Brent Sorrentino.
I had noticed something strange with multi elements but fortunately I did not use them. For the global I’ve made some changes.
Thanks for the explanations. I Take a look at the new code when you rate it for personal curiosity