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

#1 2011-08-08 00:32:50

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Help with a space game

I need help with 2 things: moving in my space game and shooting.
First moving:

I am doing it in a fashion that if you press the right arrow key it turns 8 degrees to the right and opposite way if left key is pressed. If up arrow key is pressed it faces the direction of the sprite and moves and if down key moves backwards in the direction of the sprite. But I tried point in direction direction move 3 steps if key up arrow pressed and it did not work correctly! Can somebody tell me how to do it right?

Shooting:
So if you press the key space I want it to go to the character sprite and go forward but I can't it always is a little away from the character sprite! If you want me to upload ask. Please help! In the meanwhile I will make a scrolling game.


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#2 2011-08-08 00:41:49

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Help with a space game

Your script for the shooting should look something like this, no?

Code:

When green flag clicked
forever
     if <key up arrow pressed>
          go to player_sprite
          point in direction of player_sprite
          show
          repeat until <touching enemy> or <touching edge>
               move 3 steps
          hide

As for not going exactly to the position of the sprite, the center of one of the costumes is probably set wrong. I would try adjusting that.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-08-08 01:01:18

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Help with a space game

When you said point in direction of sprite... you mean you just put in the (direction) value? It would be better to use something like point in direction (up)...

And make sure that in the paint editor, the space craft is pointing right.  wink


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#4 2011-08-08 11:56:53

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: Help with a space game

jji7skyline wrote:

When you said point in direction of sprite... you mean you just put in the (direction) value? It would be better to use something like point in direction (up)...

And make sure that in the paint editor, the space craft is pointing right.  wink

Oh. Okay. That will completely make me change my directions for the sprite but I will just make another clone in that way you said  wink .


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#5 2011-08-08 11:59:44

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: Help with a space game

Harakou wrote:

Your script for the shooting should look something like this, no?

Code:

When green flag clicked
forever
     if <key up arrow pressed>
          go to player_sprite
          point in direction of player_sprite
          show
          repeat until <touching enemy> or <touching edge>
               move 3 steps
          hide

As for not going exactly to the position of the sprite, the center of one of the costumes is probably set wrong. I would try adjusting that.

Okay. Thanks Harakou and jji7skyline!


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#6 2011-08-08 12:01:38

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: Help with a space game

Harakou wrote:

Your script for the shooting should look something like this, no?

Code:

When green flag clicked
forever
     if <key up arrow pressed>
          go to player_sprite
          point in direction of player_sprite
          show
          repeat until <touching enemy> or <touching edge>
               move 3 steps
          hide

As for not going exactly to the position of the sprite, the center of one of the costumes is probably set wrong. I would try adjusting that.

Do you know how to fix my movement problem?


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#7 2011-08-08 15:11:08

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Help with a space game

This is a little confusing, but I think this is the script you're looking for: Link.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#8 2011-08-09 14:03:00

moose12141
Scratcher
Registered: 2008-04-03
Posts: 57

Re: Help with a space game

Is it working?

Offline

 

Board footer