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

#26 2012-07-28 07:55:14

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

Yeh i've already checked some of them out with over 500 scripts in one! omg lol impressive! Thanx for ur help

Offline

 

#27 2012-07-28 07:56:45

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

yeah, the 'adventures of main guy' was a school project. I mightwin an iPod nano with it  big_smile
if you look at the script for that one, you will see all the headaches I had just by looking atthe variable names lol it was hard!


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#28 2012-07-28 08:30:32

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

I think I might be onto somthing...
Is this what you need?  smile
I hope it is right. Sorry about the colors...
http://scratch.mit.edu/projects/daniel_j/2700991

Last edited by daniel_j (2012-07-28 08:31:39)


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#29 2012-07-28 08:44:28

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

Well thats more like it  smile  but would be nice if somehow the ship could be controlled better but i just wondered if it would work better if there were 2 extra sprites- circulating above and below the direction your pointing at... (like for instance 2 moons and the earth in the middle... the earth is the ship... directly where ur pointing at (a distance away) is the first moon... 180% away from where ur pointing at is the other moon).... so if u could use if hit forward key (glide to x position + y position of the 1st moon) and hit backwards key to glide to the position of the 2nd moon- could that work? I could try and do this but would take me a day lol

Offline

 

#30 2012-07-28 08:48:20

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

Ok, I have no idea what you mean, do you mean 2 sprites circulating the ship? explain in more depth lol
Anyway. The script I gave you needs modifications, and you need to copy it for the other ship and change some variable names... do you want me to do it? xD


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#31 2012-07-28 09:06:04

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

Lol sorry hehe (i got carried away + my kids destroying things in my house- hard to think  yikes )

So like directly from where the ship is pointing at (a distance away) is another spite that always stays in the same postion/ equal distance away...

180 degrees (at a distance away) from where ur pointing at is another spite.

They both move equally + at the same distance along with the direction ur pointing at. So if u turned ur ship 360 degrees- both these added on spites will move in a circle

Mayb for the first sprite directly infront of the pointing direction (glide to x position + y position of the spite) so when u hit forward key- it may glide towards it.... same with backwards key- glide to sprite thats positioned 180 degrees from the pointing direction.

I'll try it when i get time lol... see if that works... thats the only way i think it can be done other than moving the background instead of the player

Offline

 

#32 2012-07-28 09:14:29

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

I didn't know you had kids xD
lol it's funny a 14 year old kid helping out a dad lol, that is generations useless for you xD
anyway, i'm fixing the script to work for both players, i will upload it soon  wink


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#33 2012-07-28 09:19:27

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

Ok mate, i've modified it to work with both players, see if it what you need  smile
http://scratch.mit.edu/projects/daniel_j/2700991
Is this right?


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#34 2012-07-28 09:21:03

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

lol i just woke up one day and thought- wonder if i can create a flash version of the game i used to play alot but with 0 knowledge of how to do anything figured out it was best to start using scratch  smile  Thanx for ur help btw  smile

Offline

 

#35 2012-07-28 09:22:04

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

haha that is how we all started scratch xD
check out the update I did  smile
http://scratch.mit.edu/projects/daniel_j/2700991


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#36 2012-07-28 09:23:04

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...

Oh, btw. once you master scratch you should move onto c++, it is a strong and relativly easy language to learn. I know it, it isn't too hard xD


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#37 2012-07-28 09:36:43

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Help with ship controls...


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#38 2012-07-28 12:52:12

greenfield
Scratcher
Registered: 2007-06-10
Posts: 3

Re: Help with ship controls...

How about this:

when gf clicked
forever
    change x by ((2)*([sin v] of [direction]))
    change y by ((2)*([cos v] of [direction]))
    if <key [left-arrow v] pressed?>
        turn ccw (15) degrees
    end
    if <key [right-arrow v] pressed?>
        turn cw (15) degrees
    end
    if <key [up-arrow v] pressed?>
        set [direction] to (direction)
    end
    if <key [down-arrow v] pressed?>
        set [direction] to ((direction) - (180))
    end
end

Last edited by greenfield (2012-07-28 12:53:03)

Offline

 

#39 2012-07-28 13:06:39

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Help with ship controls...

You guys, this is ridiculously easy.


when gf clicked
forever
 if <key [up arrow v] pressed?>
 change [fvel v] by (1)
 end
if <key [down arrow v] pressed?>
 change [fvel v] by (-1)
 end
 if <key [right arrow v] pressed?>
 change [tvel v] by (1)
 end
 if <key [left arrow v] pressed?>
 change [tvel v] by (-1)
 end
set [fvel v] to ((fvel) * (0.95))
set [tvel v] to ((tvel) * (0.84))
move (fvel) steps
turn cw (tvel) degrees

Last edited by berberberber (2012-07-28 13:07:28)


http://i47.tinypic.com/2iaa73k.png

Offline

 

#40 2012-07-28 13:36:14

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

Re: Help with ship controls...

Pretty sure this is a duplicate


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

Offline

 

#41 2012-07-28 15:21:22

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Help with ship controls...

MoreGamesNow wrote:

Pretty sure this is a duplicate

I merged the topics. 

To the original poster:  Please don't make duplicate topics, just keep posting on the original. 

By the way...I have some ship controls here that you might find useful

http://scratch.mit.edu/projects/Paddle2See/180740


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#42 2012-07-28 15:36:37

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

Its not a duplicate thread i promise  smile  i just cant implement adjusting the speed to the forward key unless the controls to the ship are right first...

I tried your script berberberber but i think u've mis-understood what im after and i think the only way around it is scrollx script...

Say the forward/back key is the power.... left and right key turn... when u hit the forward key it moves forward constantly in one direction ---->    While its moving ------> you can press the lefts and right keys (rotate) and the ship will still move in the same direction----->

But while your rotating the ship- if u hit the forward/backwards key again- you will move in the new direction.

The way shown on ur script moves me forward but when i hit left or right i automatically move in a new direction + move forward in that new direction.

I hope that makes sense... now is this possible? Its basically glide but is controlled using the forward and back key.

Offline

 

#43 2012-07-28 15:48:54

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

Paddle2See wrote:

MoreGamesNow wrote:

Pretty sure this is a duplicate

I merged the topics. 

To the original poster:  Please don't make duplicate topics, just keep posting on the original. 

By the way...I have some ship controls here that you might find useful

http://scratch.mit.edu/projects/Paddle2See/180740

Yes that is perfect! tyvm- this is what im after  smile )))) i just need to set the backkey the same and bingo! i'll look at the script now- tyvm for finding it yay

Offline

 

#44 2012-07-28 19:05:16

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

Looking at ur script on ur game: http://scratch.mit.edu/projects/Paddle2See/180740  How do u set the max speed to 2? Been tryin to figure it out myself for the last 3 hrs  sad  Too tierd hehe

Offline

 

#45 2012-07-29 12:17:13

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

Re: Help with ship controls...

Subsidel wrote:

Looking at ur script on ur game: http://scratch.mit.edu/projects/Paddle2See/180740  How do u set the max speed to 2? Been tryin to figure it out myself for the last 3 hrs  sad  Too tierd hehe

After changing the speed, add this:

if<(speed) > (2)>
set [speed v] to (2)
end


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

Offline

 

#46 2012-07-29 14:52:32

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: Help with ship controls...

tyvm

Offline

 

Board footer