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

#1 2012-04-04 16:46:45

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Help!!!!!

Hi, I am trying to make a Planet Generator. I need a good wall jumping script that would
work on planets (circle)

I also need to know how to make a array based raycaster. Anyone have any good scripts?

I am planing to put all of my "Help with Scripts" here, because the mods 'complain' about how much forum topics there are.

Last edited by coolhogs (2012-04-04 16:47:42)


Get ready for domination of:  tongue

Offline

 

#2 2012-04-04 19:45:37

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Help!!!!!

Is the circle bigger than the screen? As in is the character walking around a circle and the circle is rotating to the guy on top for the illusion that the character is the one moving?

Offline

 

#3 2012-04-04 19:58:21

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Help!!!!!

TorbyFork234 wrote:

Is the circle bigger than the screen? As in is the character walking around a circle and the circle is rotating to the guy on top for the illusion that the character is the one moving?

If you mean scroll, yes it is...


Get ready for domination of:  tongue

Offline

 

#4 2012-04-04 20:03:16

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Help!!!!!

Well then the guy would be meeting said walls at about 90 degree angles, so you can just program it from the angles at which the person meets the walls.

Offline

 

#5 2012-04-04 20:09:13

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Help!!!!!

No, I mean... I don't know what you are saying...


Get ready for domination of:  tongue

Offline

 

#6 2012-04-04 20:13:58

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Help!!!!!

I asked if the game is like this:
You are the person. You sit up there, at the top of a circle hopping around. Whenever you press the right key, you do the running animation but you stay at the top. The whole circle is just turning underneath you. A wall approaches, you need to jump on it, then off of it. You're not up to it yet. When you're there, you jump, and since you can only be at the top, you always meet it at the top. Not at the bottom. So you would program it like anyother walljumping thing.

Offline

 

#7 2012-04-04 20:17:34

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Help!!!!!

TorbyFork234 wrote:

I asked if the game is like this:
You are the person. You sit up there, at the top of a circle hopping around. Whenever you press the right key, you do the running animation but you stay at the top. The whole circle is just turning underneath you. A wall approaches, you need to jump on it, then off of it. You're not up to it yet. When you're there, you jump, and since you can only be at the top, you always meet it at the top. Not at the bottom. So you would program it like anyother walljumping thing.

So, how do  you do the wall jumping?
I'm not a experienced programmer...  sad


Get ready for domination of:  tongue

Offline

 

#8 2012-04-04 20:21:26

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Help!!!!!

That, I can not help you with. All I did was try to make it simpler for you. Go on the wiki, I've seen many good base projects that had amazing wall jumping. Maybe check those out.

Offline

 

#9 2012-04-04 22:04:53

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Help!!!!!

Though I personally have never used this method, you could make what people call a "sensor."  You take your main costume, duplicate it, color it so that all that's left is the silhouette, and add single-pixel dots of different colors at the four corners.  Let's say you're working with a square character.  You could color the top left of the sensor costume red, top right blue, bottom left green, bottom right yellow.  Then, you have a series of "if" conditions.

Basically, you just test the different possibilities.  Important: Put all the if statements under the same loop.  You can change the costume to the sensor at the beginning of the loop and then back to the character at the end (you won't be able to see the sensor).

For instance:

Code:

while(playing == true)
{
  switch to costume (sensor)
  if ((color.red isTouching color.black) && (color.green isTouching color.black))
  {
    This is a collision with a left wall.
  }
  switch to costume (player)
}

Offline

 

#10 2012-04-04 22:49:54

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: Help!!!!!

if <<key [up v] pressed?> and <touching [wall sprite v] ?>>
  set [x velocity v] to ((0) - (x velocity))
  set [y velocity v] to (10)
end
You can change around the y velocity thing to suit your needs.  big_smile

Last edited by applejack (2012-04-04 22:52:54)


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#11 2012-04-04 22:58:57

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Help!!!!!

applejack wrote:

if <<key [up v] pressed?> and <touching [wall sprite v] ?>>
  set [x velocity v] to ((0) - (x velocity))
  set [y velocity v] to (10)
end
You can change around the y velocity thing to suit your needs.  big_smile

The script wouldn't work. What if he didn't jump but he's touching the wall?

Offline

 

#12 2012-04-04 23:02:36

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: Help!!!!!

This is only if you want a wall jump. If you touch the wall but don't jump, nothing happens.

TorbyFork234 wrote:

applejack wrote:

if <<key [up v] pressed?> and <touching [wall sprite v] ?>>
  set [x velocity v] to ((0) - (x velocity))
  set [y velocity v] to (10)
end
You can change around the y velocity thing to suit your needs.  big_smile

The script wouldn't work. What if he didn't jump but he's touching the wall?


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#13 2012-04-05 14:04:23

aryabtsev
Scratcher
Registered: 2012-02-05
Posts: 81

Re: Help!!!!!

If you're trying to make a 3D kind of maze using raycaster, you can download this project and see how it works...
http://scratch.mit.edu/projects/aryabtsev/2422387

P.S. Some people prefer to have multiple "sensors" for faster rendering.

Last edited by aryabtsev (2012-04-05 14:06:12)


http://i.imgur.com/NX7AO.jpg

Offline

 

#14 2012-04-06 17:25:47

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Help!!!!!

aryabtsev wrote:

If you're trying to make a 3D kind of maze using raycaster, you can raycastdownload this project and see how it works...
http://scratch.mit.edu/projects/aryabtsev/2422387

P.S. Some people prefer to have multiple "sensors" for faster rendering.

No, like WES64's Raycast. Like, you are in a room..

Last edited by coolhogs (2012-04-06 17:26:31)


Get ready for domination of:  tongue

Offline

 

Board footer