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

#1 2009-12-01 10:20:52

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

A Few Questions

Hey guys, completely new here. Started using Scratch since yesterday (programming professor introduced this to us and I'm using this to program an action adventure game using multiple screens)

Firstly, I've watched a number of tutorials but they are really basic.

Now for the "simple" questions. Since I'm using multiple stages, is it possible to have a programming window for all of them or am I stuck to using just the one for each level?

When I import sprites they automatically appear on screen, but I need each one to be on their respective screens only.

Now for "intermediate" questions.

I'm using the classic Megaman sprite as my main character and as many of you know he uses a megabuster as his main weapon. I'd like to know the easiest way to use weaponry.

Does Scratch recognize gifs or am I stuck with having to costume changes continuously each key press/key hold?

Since this is an action/adventure game, I'm going to assign health for the main character and the enemies/bosses. I'd like to know the easiest way to do this.

I sorta have a grasp on the basics of basic programming from previous experiences but this is completely different from things I have used in the past.

I greatly appreciate any help/suggestions  big_smile

Last edited by Weredawg (2009-12-01 10:21:59)

Offline

 

#2 2009-12-01 10:41:02

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: A Few Questions

Weredawg wrote:

Since I'm using multiple stages, is it possible to have a programming window for all of them or am I stuck to using just the one for each level? Scratch doesn't support multiple stages but you can use many backgrounds and switch between them.

When I import sprites they automatically appear on screen, but I need each one to be on their respective screens only. Use a script that checks the currenct background, and uses the command "Show" or "Hide" depending on what's the bg.

Now for "intermediate" questions. Ok...

I'm using the classic Megaman sprite as my main character and as many of you know he uses a megabuster as his main weapon. I'd like to know the easiest way to use weaponry. Put this in the bullet sprite

[blocks]<when green flag clicked>
<hide>

<when[ whichever you want ]key pressed>
<go to[ megaman
<repeat until><< <touching[ enemy <or> <touching[ edge >>
<change x by( 50 or any number (this will only let you shoot to the right though)
<end>[/blocks]

Does Scratch recognize gifs or am I stuck with having to costume changes continuously each key press/key hold? You'll have to do the second way you mentioned.

Since this is an action/adventure game, I'm going to assign health for the main character and the enemies/bosses. I'd like to know the easiest way to do this. Sprite-only variables.

I sorta have a grasp on the basics of basic programming from previous experiences but this is completely different from things I have used in the past. Same here lol, I've tried Ruby and Game Maker before, and Scratch was different (in a good way, to me)

There ya go.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#3 2009-12-01 11:48:46

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

Thanks. This is going to take a lot of trial and error. Hey, so for our scripts, is it all just in one window or can I put them into separate ones? I know that the more intricate games would have a good amount of scripts.

Does anyone know if it is at all possible to shoot left in Scratch?

Last edited by Weredawg (2009-12-01 12:07:49)

Offline

 

#4 2009-12-01 12:00:48

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: A Few Questions

Weredawg wrote:

Thanks. This is going to take a lot of trial and error. Hey, so for our scripts, is it all just in one window or can I put them into separate ones? I know that the more intricate games would have a good amount of scripts.

You can't have a sprite's scripts in separate windows.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#5 2009-12-01 12:03:56

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

Re: A Few Questions

Now for the "simple" questions. Since I'm using multiple stages, is it possible to have a programming window for all of them or am I stuck to using just the one for each level?

A: Just one programming window

When I import sprites they automatically appear on screen, but I need each one to be on their respective screens only.

A: For this you need to tell the sprite what state to appear on. So if(stage=2) then make the sprite appear else make it hide.

Now for "intermediate" questions.

I'm using the classic Megaman sprite as my main character and as many of you know he uses a megabuster as his main weapon. I'd like to know the easiest way to use weaponry.

A:It all depends on how you precisely want it it act. I know megaman has many different weapons and needs different scripts for each shot that behaves differently. You could try adapting the shooting scripts in this project to suit your needs http://scratch.mit.edu/projects/archmage/112445

Does Scratch recognize gifs or am I stuck with having to costume changes continuously each key press/key hold?

A: you can import animated gifs but they get separated into different costumes. The best way to make a character animate is demonstrated here http://scratch.mit.edu/projects/archmage/291819

Since this is an action/adventure game, I'm going to assign health for the main character and the enemies/bosses. I'd like to know the easiest way to do this.

A: make a variable called health, when the character is hurt make the variable smaller.

I sorta have a grasp on the basics of basic programming from previous experiences but this is completely different from things I have used in the past.

I greatly appreciate any help/suggestions  big_smile

Here's a tip, don't try to run before you can walk. Make basic projects and work your way up. You can try making separate projects that do just one of the things you need for the kind of game you are describing ie. running, shooting, ect.

Last edited by archmage (2009-12-01 12:05:29)


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

 

#6 2009-12-01 12:13:07

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

Thanks for all the help guys. Well...this thing is due Thursday. I got my intro and all the cutscenes out of the way. So with the provided scripts, combined properly I should get this done in time. I may cut out a few levels for the sake of saving time.

Offline

 

#7 2009-12-01 13:03:49

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

archmage wrote:

When I import sprites they automatically appear on screen, but I need each one to be on their respective screens only.

A: For this you need to tell the sprite what state to appear on. So if(stage=2) then make the sprite appear else make it hide.

I can't find your example of (stage = 2), making variables are round and if/else use diamonds. Where/how is it done?

Offline

 

#8 2009-12-01 17:17:10

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: A Few Questions

Weredawg wrote:

archmage wrote:

When I import sprites they automatically appear on screen, but I need each one to be on their respective screens only.

A: For this you need to tell the sprite what state to appear on. So if(stage=2) then make the sprite appear else make it hide.

I can't find your example of (stage = 2), making variables are round and if/else use diamonds. Where/how is it done?

like this.
[blocks]
<( <{ stage }> <=> 2 )>
that fits like:
<if><( <{ stage }> <=> 2 )>
<else>
<end>
[/blocks]
The = block is in the operators section.

Last edited by 16Skittles (2009-12-01 17:18:42)


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#9 2009-12-01 20:13:02

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: A Few Questions

Weredawg, when you say "multiple stages" are talking about ity scrolling?

If so, download and look at the scripts of archmages's "Effecient Scrolling" project.

Offline

 

#10 2009-12-02 05:21:11

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

samurai768 wrote:

Weredawg, when you say "multiple stages" are talking about ity scrolling?

Both actually. I figured out how to go from one frame to the next. I'm thinking of creating one level that involves scrolling but it's only going to consist of the character moving to the right, touching a teleporter and going to the final stage. For effects, I may add explosion sprites in the background.

This is a stretch but I was thinking of creating the effect of a place ready to blow. You know, the screen shakes. I was thinking that I would have to take the images used as backgrounds and used them as sprites then ran them to move in a pattern.

If so, download and look at the scripts of archmages's "Effecient Scrolling" project.

Yeah I've downloaded some of his stuff. Really good, and helpful.

Offline

 

#11 2009-12-02 11:43:52

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

16Skittles wrote:

Weredawg wrote:

archmage wrote:

When I import sprites they automatically appear on screen, but I need each one to be on their respective screens only.

A: For this you need to tell the sprite what state to appear on. So if(stage=2) then make the sprite appear else make it hide.

I can't find your example of (stage = 2), making variables are round and if/else use diamonds. Where/how is it done?

like this.
[blocks]
<( <{ stage }> <=> 2 )>
that fits like:
<if><( <{ stage }> <=> 2 )>
<else>
<end>
[/blocks]
The = block is in the operators section.

Hey I'm still not able to get it to work.  hmm  Here's what I've got. The stage stuff is incomplete (for now)
When clicked, switch stage to background [background1], set stage to 1, wait 2 secs, switch background [square enix], set stage to 2, I do this same pattern until I get to the wormhole background which I set to stage 6

For the sprite: when clicked, if stage = 6, show, got to x(97) y(16) <- I do this a number of times, making him glide to each new position, then hide, the if statement closes

What am I doing wrong? Sorry I didn't use images

Offline

 

#12 2009-12-02 12:01:08

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

Re: A Few Questions

The sprites code should look something like this

when clicked{
forever {
if stage=6{
show}
else{
hide
} set oldStage (local variable) to stage
wait until (oldStage!=stage)
}
}

And if you want to make the entire background scroll the glide block will probably hurt more than help but that all depends on how your project is setup. If that is working out for you continue using it.

If you want better advice then you should upload your project for people to look at it.


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

 

#13 2009-12-02 13:13:59

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

I'm really trying. I can't upload it because it's too big.  hmm  I'll get it eventually.

Hey guys, I've finally gotten animation and shooting down  big_smile  Now I want to create invisible walls in the "sky" area so he's not "flying" where ever he wants. I took an image of the potion I want to block and made it into a sprite. How do I make it so that when he comes in contact with this that he won't go up?

After this, it's on to enemy AI (I may just end up doing the boss).

Thanks for the help guys ^_^

Last edited by Weredawg (2009-12-02 14:58:32)

Offline

 

#14 2009-12-02 17:56:10

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: A Few Questions

Weredawg wrote:

I'm really trying. I can't upload it because it's too big.  hmm  I'll get it eventually.

Hey guys, I've finally gotten animation and shooting down  big_smile  Now I want to create invisible walls in the "sky" area so he's not "flying" where ever he wants. I took an image of the potion I want to block and made it into a sprite. How do I make it so that when he comes in contact with this that he won't go up?

After this, it's on to enemy AI (I may just end up doing the boss).

Thanks for the help guys ^_^

You dont have to make a image copy of that (unless you want to ^-^)

Just make a red (or any color) sprite that's about the same size as the part you wanna block, then make the script this:
When green flag clicked;
hide
go (x) (y)


Then for the megaman sprite:
when green flag clicked:
forever
if <touching [red sprite]>
change y by -5
else
wait 0 secs
end forever

the else is just in case  wink

Offline

 

#15 2009-12-02 18:54:06

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

I'm going to do a couple of levels, probably side scrolling ones. The invisible walls won't apply anymore due to the change in platforming. I wanted my character to move in all directions but it's easier to sticking to preset levels, plus this thing is due tomorrow morning for presentation. The really hard part is figuring out Ai especially since this one has many more animations and conditional situations for things to occur. Plus I need to figure out the effects of attack and health.

Oh, I'm still having troubles with sprites sticking to their own areas, any projects I can look at for examples on how to do this?

Any suggestions for enemy Ai and the health system would be greatly appreciated.

Side note: Just because I'm doing this for a class doesn't mean I'm not gonna stick around. I may pick this up as a hobby. Years ago I made games using Megazeux, very bland and "limited"

Last edited by Weredawg (2009-12-02 19:00:09)

Offline

 

#16 2009-12-02 22:33:11

Weredawg
Scratcher
Registered: 2009-11-30
Posts: 11

Re: A Few Questions

Hey guys, I uploaded it: http://scratch.mit.edu/projects/Weredawg/787150
The problems are obvious. Mainly keeping sprites in their place, and one either minute detail (a missing frame in Megaman's walking motion). I want to give him the ability to have 3 bullets on screen at one time.

Offline

 

Board footer