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

#1 2012-02-28 13:08:19

plobnob
Scratcher
Registered: 2011-07-11
Posts: 12

I need some help.

Well i managed to make a new project of which a link can be fonud at the end of this post. For now, please read this carefully as I need to improve it.

Simply put, i have made a project which can travel up and down hills and point at the angle of the hill. At the moment it is not scrolling, and thats my problem. I know how to scroll normally with scrollx, but this is different. This is because it points in the angle of the hill and then walks. Instead of walking in scrolling, there is travelling sideways. As far as I know it is very difficult to get it to move up hills alongside facing in the direction. If you wish to help me in this massive hurdle, you will first need to know how the script works.

NOTE: When I say character touching, I mean the sensor found on the front right of the character, a black spot.

The script works by saying if the character is moving right and it touches the inner land colour, it will repeat until it is not touching the inner land colour rotate left. It will then be able to move again, thus changing it to the angle of the hill. When going down the hill, it sais if travelling right (done via variable) if touching sky colour repeat until not touching sky colour rotate right. Once again, it can now move. I have done the same thing except with travelling left instead of right, in reverse though.

With scrollx only travelling sideways, it points towards the land but can't actually move up it. The only way I could think of doing it would to be by adding scroll y, but I think it would then require a script per direction the character can face, so 360 scripts/ groups of scripting.

If you have any suggestions on how I could make this game scrolling, please post. Feel free to post your thoughts. Anyway, here is the project: Project here

Thanks,
             Plobnob.  big_smile

Last edited by plobnob (2012-02-28 13:09:56)

Offline

 

#2 2012-02-29 15:24:59

plobnob
Scratcher
Registered: 2011-07-11
Posts: 12

Re: I need some help.

bump. anyone help?

Offline

 

#3 2012-03-02 17:36:00

plobnob
Scratcher
Registered: 2011-07-11
Posts: 12

Re: I need some help.

anoyone? I tried a new tactic and it still didnt work.

Offline

 

#4 2012-03-02 18:35:06

Luke121
Scratcher
Registered: 2008-07-14
Posts: 1000+

Re: I need some help.

I'd recommend using Sine and Cosine to find the angle of the character, and then adjust the velocity of the scroll accordingly.


http://bit.ly/IlVuB5
Sorry PF, too lazy to make my own!  tongue

Offline

 

#5 2012-03-03 06:14:06

plobnob
Scratcher
Registered: 2011-07-11
Posts: 12

Re: I need some help.

ok, but its mainly the up and down i need. As far as I know I would have to judge all 360 angles to determine how much y it needs to change. Anyways, thanks for your help.

Offline

 

Board footer