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

#1 2009-12-02 10:16:21

Dogcake
Scratcher
Registered: 2009-12-02
Posts: 4

Movement help and other questions.

Hello everyone

Just started scratch recently and I am finding a few difficulties with a few things I want to try and get done.

My first problem is movement.  I can make a sprite move back and forth but for my side scroller shooter I am trying to make the sprite move forward while alternating in the y axis, shape of a transverse wave?

This is leading to my second problem for the enemy sprite. The sprite should go to the player sprite to do damage but when I try using the goto box nothing seems to work at the moment. Can anyone show show me a guide that could help me with the problems or explain what I can do?

thanks.

Offline

 

#2 2009-12-02 10:24:25

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Movement help and other questions.

A good way to learn things is to look at the source code of different projects since all scratch projects are available for download (look above the project notes).

For question 1, by transverse wave, I'll assume that you want to jump in a arc. For that you can just copy the jumping scripts from this project
http://scratch.mit.edu/projects/archmage/635312

For the enemy sprite, the code that controls its movement should look a little like this x=(scrollX-movement) So in order it to go to the player you have to change the movement variable. Again I did something like this in the example project I posted.

Last edited by archmage (2009-12-02 10:25:04)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2009-12-02 14:24:53

Dogcake
Scratcher
Registered: 2009-12-02
Posts: 4

Re: Movement help and other questions.

Sorry archmage I should not of been so vague in my description. The project I am working on is a side scroller shoot em up like r type. I have been trying to make enemy move in a wave direction so they will be harder to shoot. The same enemy while moving in the alternating arc direction should be aiming to hit the player.

I'm not sure if that makes anymore sense :s

Thanks you for the link though! Taking a look at those scripts It will definetly help me with the scrolling background.

Offline

 

Board footer