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

#1 2007-07-28 12:44:25

Soda
Scratcher
Registered: 2007-07-28
Posts: 1

Variable Sensing?

Well, I'm making a Breakout style game, but when you miss the ball, it only takes away a life. And I want it to sense once theres 0 lives left. Anyway I can do this? I normally work with flash, but I'm testing out scratch for my school. So I'm used to those advanced features.

Offline

 

#2 2007-07-28 12:56:39

qqqqqq582
Scratcher
Registered: 2007-05-19
Posts: 4

Re: Variable Sensing?

I want to use flash!!!

Offline

 

#3 2007-07-28 12:57:54

qqqqqq582
Scratcher
Registered: 2007-05-19
Posts: 4

Re: Variable Sensing?

smile

Offline

 

#4 2007-07-28 15:30:13

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Variable Sensing?

Just after the "take away a life" script you need another "If" block

If lives<1
  - (end game script of your choice)


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#5 2007-07-28 18:29:58

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

Re: Variable Sensing?

Ah flash is great. If you know actionscript this should be a breeze.

(in scratch block code)

when flag clicked
Forever
if lives = 0
broadcast showgameover {make gameoverscreen come}
stop all

Get the trial of flash CS3 here https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash

and for fun the same code in flash actionscript (you can kinda see the similarities)

///on root frame
var
lives=3;

/// in ball movieclip
onClipEvent (enterFrame)
{if (_root.lives == 0) {
///go to gameover frame
_root.gotoAndStop(2);
this.removeMovieClip();}
}
///coding in flash is a lot slower and harder than scratch  wink

Last edited by archmage (2007-07-28 18:56:01)


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 2007-07-28 19:39:16

DrJim
Scratcher
Registered: 2007-05-26
Posts: 100+

Re: Variable Sensing?

It was quite interesting to see a small sample of Scratch and of Actionscript code together - maybe others can also supply this in the future.  Another tool to experiment with Flash is 3D Flash Animator, available at http://www.3dfa.com/ .  The free version has most of the save options disabled but otherwise seems to work well (not that my programming will stress any software) and the registered version is only about $50.

Offline

 

#7 2007-07-28 20:35:10

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

Re: Variable Sensing?

If you are looking for a decent free flash maker try liveswift
http://www.liveswif.net/


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

 

#8 2007-09-06 16:12:39

dinther
Scratcher
Registered: 2007-08-22
Posts: 19

Re: Variable Sensing?

Using scratch to generate Actionscript code for flash would be an awesome idea.


Find out what it is like to steer large ships into the Port of Rotterdam in ShipSim http://scratch.mit.edu/projects/dinther/32891

Offline

 

#9 2007-09-06 16:34:07

dinther
Scratcher
Registered: 2007-08-22
Posts: 19

Re: Variable Sensing?

Actually, I think this can be done. I just played with Flash Animator. Much much faster. Better graphics and I think an automated translation of scratch to Action Script is possible.

There is another added advantage because the flash player in the Scratch IDE will be the same as the flash player on the web-site. So no more differences in speed and behaviour.

Dump Java guys. Go for flash instead.

I think I buy myself a copy of http://www.3dfa.com/ to learn more.


Find out what it is like to steer large ships into the Port of Rotterdam in ShipSim http://scratch.mit.edu/projects/dinther/32891

Offline

 

#10 2007-09-06 18:14:20

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

Re: Variable Sensing?

Dinther, if you want to get a good feel for flash I recommend that you download and try flash CS3 and the trial is good for 30 days. Macromedia flash is the program most commonly used for flash creation and in my opinion it's probably the best.

https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash

Plus if you want to learn action script the 3D flash animator is not a good choice as it uses a game maker style approach to programming.


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

 

Board footer