Hello, just a small post for anyone interested in this,
https://www.youtube.com/watch?v=ZGOMHp2pYkI
Thanks to nemo for the help !
It is not perfect, but i hope it might give you some ideas !
One problem, as seen in video, the hedgehog doesnt move with the girder, might be possible to find a solution with setgearvelocity and gearisinbox but i had no sucess for now,
Same problem with the Portals, in this state it is not ready to implement in a portal mission :p
But for some map mission, shooting mission etc... might be cool !
CODE : hover with your mouse to expand the code
[quote]girderswitch = false
PlaceSprite(xgirder, ygirder, sprAmGirder, 4)
function onGameTick20()
if CurrentHedgehog ~= nil then
if (xgirder <= 750) and (girderswitch == false) then
EraseSprite(xgirder, ygirder, sprAmGirder, 4)
xgirder = xgirder+1
PlaceSprite(xgirder, ygirder, sprAmGirder, 4)
if (xgirder == 750) then
girderswitch = true
end
end
if (xgirder >= 300) and (girderswitch == true) then
EraseSprite(xgirder, ygirder, sprAmGirder, 4)
xgirder = xgirder-1
PlaceSprite(xgirder, ygirder, sprAmGirder, 4)
if (xgirder == 300) then
girderswitch = false
end
end
end
end[/quote]
edit, thanks to nemo i have now this code :
if (xgirder <= 750) and (girderswitch == false) then
EraseSprite(xgirder, ygirder, sprAmGirder, 4)
xgirder = xgirder+1
PlaceSprite(xgirder, ygirder, sprAmGirder, 4)
if gearIsInBox(player, xgirder-90, ygirder-20, 180, 10) then
-- SetGearVelocity(player, dx+1, dy+0)
SetGearPosition(player, xplayer+1, yplayer)
end
if (xgirder == 750) then
girderswitch = true
end
end
allow your hog to move with the girder ! not perfect when you try to walk to the left (when the girder is going to the right), but let say it is because it is magic... :p
[center] the beachs hogs surfin hedgewars [/center]
[IMG]http://imgur.com/HJSMewv[/IMG]