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

#1 2011-03-20 17:53:54

woofwoof301
Scratcher
Registered: 2008-06-01
Posts: 100+

Arg! Gravity And Jumping Dilima!

Currently, I am making a game that involves a stick man scroller running around shooting zombies and AI that can move back and forth and jump up to a higher level to shoot you. If you check my user, you will see I haven't uploaded a project in a while, and I am just DYING to upload my hard work. However, I am stuck.

Problem:

I made a code where, when the Sprite is not touching the basic color black, it changes gravity by -1. When it finally touches black, it sets the gravity to 0. However, I need the AI to float up to the next level. So I first tried just

Repeat until touching black-
Change gravity by 2



But then the AI can't get off the ground because it already is touching the color.

Also, I tried increasing the jump height, but the second the value goes to 100 or 1 or 5, it instantly gets reset to 0, because of previous code listed above. black.

I then tried:

Change y by 2.


That resulted in the AI just completely zooming off the screen.



I've tried plenty other ideas, but really, I'm stumped. Its been two years, I'm really out of ideas. Community, please help me so you guys can enjoy my project.

Offline

 

#2 2011-03-20 18:03:08

woofwoof301
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Arg! Gravity And Jumping Dilima!

Somebody help me? I still can't jump


<stop all sounds>

Last edited by woofwoof301 (2011-03-20 18:03:37)

Offline

 

#3 2011-03-20 18:11:37

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Arg! Gravity And Jumping Dilima!

repeat untill not touching black:
change gravity by 2
repeat untill touching black:
change gravity by 2

Hope this helps  wink


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

Board footer