This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-09-06 14:42:28

JamieBruce
Scratcher
Registered: 2012-08-05
Posts: 52

walls and cielings

I have a project with walls and cielings this is NOT a problem I just want scripting for walls
and cielings also I will upload it called the adventures of oreo,sandstone and flopsy also if you fix
this walls=gray cielings=blue heare a the scripts

when gf clicked
if < touching color green? >

else
change y by 1
end
sorry if this comes out wrong  tongue

Last edited by JamieBruce (2012-09-06 15:01:50)


help my project "the adventures of oreo,sandstone and flopsy"
[url=file:///C:/Users/Jamie/Desktop/JBcaptain/JBcaptain.htmL[/url]

Offline

 

#2 2012-09-17 22:19:38

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: walls and cielings

Let me work this out.


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#3 2012-09-17 22:38:21

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: walls and cielings

This may be a bit to complicated but this is for wall detection and your character will will run up slopes as well. This does not cover the ceiling though.

when gf clicked
forever 
change x by (xvelocity)
change y by (yvelocity)
if <touching [course v]?>
set [xcollision v] to (1)
else
set [xcollision v] to (0)
end
if <(xcollision) = (1)>
if <touching [course v]?>
change y by (xvelocity)
if <touching [course v]?>
change y by (xvelocity)
if <touching [course v]?>
change y by (xvelocity)
if <touching [course v]?>
change y by <(xvelocity) * (-3)>
change x by <(xvelocity) * (-1)>
set [xvelocity v] to (0)
end
else
change y by <(xvelocity) * (-1)>
end
else
change y by <(xvelocity) * (-1)>
end
else
change y by <(xvelocity) * (-1)>
end
If it's too complicated just say so.


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#4 2012-09-18 07:41:51

TPAL125
Scratcher
Registered: 2012-06-09
Posts: 18

Re: walls and cielings

If this is just for ceilings (and floors) and walls then use this script:

when gf clicked
forever
change x by (xvel)
if <touching [platform v]>
change x by ((0) - (xvel))
set [xvel v] to ((xvel) / (3))
change x by (xvel)
if <touching [platform v]>
change x by ((0) - (xvel))
set [xvel v] to ((xvel) / (3))
change x by (xvel)
if <touching [platform v]>
change x by ((0) - (xvel))
set [xvel v] to ((xvel) / (3))
end
end
end
change y by (yvel)
if <touching [platform v]>
change y by ((0) - (yvel))
set [yvel v] to ((yvel) / (3))
if <<(yvel) < (0)> and <key [up arrow v] pressed?>> //this is for jumping
set [yvel v] to [whatever you want]
else
change y by (yvel)
if <touching [platform v]>
change y by ((0) - (yvel))
set [yvel v] to ((yvel) / (3))
change y by (yvel)
if <touching [platform v]>
change y by ((0) - (yvel))
set [yvel v] to ((yvel) / (3))
end
end
end
end
end
Sorry if this doesn't work.

This is only for collision. Nothing else (besides the jumping. You need to know where jumping is.).

And just so you know, its's not me that came up with this script.

Offline

 

#5 2012-09-18 07:45:49

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: walls and cielings

TPAL125 wrote:

If this is just for ceilings (and floors) and walls then use this script:

when gf clicked
forever
change x by (xvel)
if <touching [platform v]?>
change x by ((0) - (xvel))
set [xvel v] to ((xvel) / (3))
change x by (xvel)
if <touching [platform v]?>
change x by ((0) - (xvel))
set [xvel v] to ((xvel) / (3))
change x by (xvel)
if <touching [platform v]?>
change x by ((0) - (xvel))
set [xvel v] to ((xvel) / (3))
end
end
end
change y by (yvel)
if <touching [platform v]?>
change y by ((0) - (yvel))
set [yvel v] to ((yvel) / (3))
if <<(yvel) < (0)> and <key [up arrow v] pressed?>> //this is for jumping
set [yvel v] to [whatever you want]
else
change y by (yvel)
if <touching [platform v]?>
change y by ((0) - (yvel))
set [yvel v] to ((yvel) / (3))
change y by (yvel)
if <touching [platform v]?>
change y by ((0) - (yvel))
set [yvel v] to ((yvel) / (3))
end
end
end
end
Sorry if this doesn't work.

This is only for collision. Nothing else (besides the jumping. You need to know where jumping is.).

And just so you know, its's not me that came up with this script.

Fixed.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#6 2012-09-18 11:46:02

JamieBruce
Scratcher
Registered: 2012-08-05
Posts: 52

Re: walls and cielings

bullelk12 wrote:

Let me work this out.

it is very laggy online help!


help my project "the adventures of oreo,sandstone and flopsy"
[url=file:///C:/Users/Jamie/Desktop/JBcaptain/JBcaptain.htmL[/url]

Offline

 

Board footer