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

#1 2010-01-02 13:55:07

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Script Update Order Manipulation?

Hey everyone,

During development of my recent game I've been trying to devise a way to make the HUD sprite execute it's code before the bombs, and that before the Bomber so that the HUD doesn't erase the bomb stamps and the bomber detects the explosion. I devised a method that worked for the first round, but after the postgame carnage screen the ordering did not work (2nd round and above).

Click here to download the project.

Does anyone know how to make this work?

Thanks,
RHY3756547.

Offline

 

#2 2010-01-02 14:18:40

Brass45
Scratcher
Registered: 2009-05-03
Posts: 500+

Re: Script Update Order Manipulation?

I don't understand 2/3 of the scripts in the game,but if you mean you need a way to clear the HUD without erasing the bomb explosion then just use a costume the same color as the background that stamps itself over the HUD.


http://img412.imageshack.us/img412/4593/ubd1591.png<--Our website(click)
http://static.zooomr.com/images/8884671_b196719ffa_o.png<--If this image looks interesting,then click it to see an exclusive sneak peak of Evil Strings newest game:DarkLight

Offline

 

#3 2010-01-02 14:28:47

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Script Update Order Manipulation?

Brass45 wrote:

I don't understand 2/3 of the scripts in the game,but if you mean you need a way to clear the HUD without erasing the bomb explosion then just use a costume the same color as the background that stamps itself over the HUD.

The stage needs to be cleared every frame for the HUD and the Bombs.  hmm

Offline

 

#4 2010-01-02 14:40:09

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: Script Update Order Manipulation?

I don't know what you mean.

Offline

 

#5 2010-01-02 14:50:35

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Script Update Order Manipulation?

BWOG wrote:

I don't know what you mean.

This always happens when I ask for help.

OK - the UI and bomb effect are printed onto the stage.

The UI's code erases the stage and prints the UI
The Bomb's code prints an explosion graphic when it is exploding.
The player detected the explosion colour and if touching it dies.

The UI code needs to be executed before the bomb's explosion every frame otherwise the bomb is erased from the stage before the player detects the collision - thus the player does not die and the explosion is invisible. The player needs to be executed after the bomb otherwise the player will be detecting for something that hasn't happened yet.

So:

Sprite 1 in order:
UI erases stage => Empty Stage => Prints UI onto stage => UI printed

Sprite 2 in order:
Bomb querys if is exploding or not => if it is then it stamps the explosion => The explosion is now on the stage

Sprite 3 in order:
Stage has UI and explosions printed => Player detects if touching explosion colour => If it is then sets "Died?" to 1.

I need the sprites to execute the code in this way and no other.

Offline

 

#6 2010-01-02 14:58:46

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Script Update Order Manipulation?

I'm downloading it... let me see what I can do.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#7 2010-01-02 14:59:21

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Script Update Order Manipulation?

Ah - i found out the issue. The order doesn't change if you re-call a broadcast that is already running (forgot to make the script stop when the bomb isn't placed)

Offline

 

#8 2010-01-02 15:08:44

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Script Update Order Manipulation?

Oh wow this is great  smile

Unrelated to your problem: Yeah this is really impressive. Although may I reccomend using array-based collision like in my projects?

Related to your problem: I dunno


http://i.imgur.com/WBkM2QQ.png

Offline

 

#9 2010-01-02 15:12:58

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Script Update Order Manipulation?

Lucario621 wrote:

Oh wow this is great  smile

Unrelated to your problem: Yeah this is really impressive. Although may I reccomend using array-based collision like in my projects?

Related to your problem: I dunno

Array based collision is buggy and inaccurate. Sure - it is a tile based game (16x16) but normal collision is much less script intensive, simpler for potential remixers to understand and on the overall more supportive.

Offline

 

#10 2010-01-02 15:22:01

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Script Update Order Manipulation?

RHY3756547 wrote:

Lucario621 wrote:

Oh wow this is great  smile

Unrelated to your problem: Yeah this is really impressive. Although may I reccomend using array-based collision like in my projects?

Related to your problem: I dunno

Array based collision is buggy and inaccurate. Sure - it is a tile based game (16x16) but normal collision is much less script intensive, simpler for potential remixers to understand and on the overall more supportive.

Says you >.>

Challenge me  tongue  Should I make another engine lolz?


http://i.imgur.com/WBkM2QQ.png

Offline

 

#11 2010-01-02 23:44:37

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Script Update Order Manipulation?

Hmmm i m mending it  smile

OMG U  GOT IT !!!!!!!

anyways but i dunno why it isnt opening the file


aarrrghhh why dont u use 4shared instead .


ARRGGGHHH HAVE U SEEN THAT INTERNET EXPLOER FIXES THE PROBLEM AUTOMATICALLY WHAT THE HELL MICROSOFT

Last edited by fanofcena (2010-01-03 00:31:21)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

Board footer