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

#1 2012-03-29 14:29:59

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

jumping, top collision help,

so this is a side scroller game, keep in mind that it doest scrollY when jumping just player moves up, anyway the topsensors move down 10-y when it detects something but he still goes a bit through the roof a bit and then goes down, anyway to fix this? it's not a problem but I am a bit of a perfectionist...


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

#2 2012-03-29 17:30:02

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: jumping, top collision help,

Maybe make the top-sensor higher or taller?  I can't really help without some script/a project to work with.  hmm


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-03-30 04:23:25

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

Re: jumping, top collision help,

good idea but that won't fix the problem ^^^


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

#4 2012-03-30 07:40:54

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: jumping, top collision help,

Try to do multi-tasking. If they are separate sprites, this will not work. It will lag and glitch really bad. If you know how to multi-task, use the 1s1s stamping method, if you don't give it a hat or something to make the top distinct. Then:

if<color [] is touching []?>
 change y by ((0) - (y vel))
 set [yvel v] to (0)
end
If no velocity:
if <touching [sensor is touching ceiling v]?>
 change y by (-1)
  if <touching [sensor is touching ceiling v]?>
   change y by (-1)
    if <touching [sensor is touching ceiling v]?>
     change y by (-1)
      if <touching [sensor is touching ceiling v]?>
       change y by (-1)
      end
    end
  end
end
And unwrap that until it runs perfectly. DO NOT use the repeat block or it will be painfully slow.

Last edited by chanmanpartyman (2012-03-31 12:03:57)

Offline

 

#5 2012-03-30 15:04:55

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

Re: jumping, top collision help,

what.....?
ummm why would I give it a hat?
how would that script work? it is basically what I just said I did but didn't work
did you read my post properly?
this project has no velocity if that's what vel is....
I might as well post this.

when gf clicked
if topsensors = 1
change y by -10
end


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

#6 2012-03-30 15:07:23

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

Re: jumping, top collision help,

topsensors= variable btw

and as for w key or jumping, this next script complicatedly basic, it's change y by 1, wait ___ seconds and that repeated alot...  and then vice versa but with - infront of 10 making sense?


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

#7 2012-03-31 12:05:14

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: jumping, top collision help,

Edited my post, check it out again (thought you wouldn't check back on my post)

Offline

 

#8 2012-04-01 09:18:08

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

Re: jumping, top collision help,

hmm I can automatically tell that this will work, I kinda knew that something like that would fix the problem but I was hoping for a more efficient way, anyway thanks.


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

Board footer