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

#1 2013-01-19 11:32:11

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Help Please!

My project is here : http://scratch.mit.edu/projects/Jakekerrigan/3047648

I'm creating a game and I tried to add a double xp powerup.

I've done the timer correct, but I'm having problems with getting the double xp to work. I would appreciate and credit any help given, please download my game and try to figure it out  smile

Offline

 

#2 2013-01-19 11:56:44

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Jakekerrigan wrote:

My project is here : http://scratch.mit.edu/projects/Jakekerrigan/3047648

I'm creating a game and I tried to add a double xp powerup.

I've done the timer correct, but I'm having problems with getting the double xp to work. I would appreciate and credit any help given, please download my game and try to figure it out  smile

Well first I have a quick question; do you want the variable Double XP to be a score multiplier or a count down timer?


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-01-19 12:02:56

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

A countdown timer. Just 10 seconds or so. So whenever the timer is up everything you collect has x2 points  smile

Offline

 

#4 2013-01-19 12:07:29

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

Hmm I misread your question. I guess both a countdown timer and a score multiplier?

Offline

 

#5 2013-01-19 12:38:14

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Jakekerrigan wrote:

Hmm I misread your question. I guess both a countdown timer and a score multiplier?

No, you answered it correctly. I'll be back in a few minutes...

Okay, so in your Double XP box, you had a script like this:

when gf clicked
show variable [double XP v]
set [Double XP v] to (10)
forever
 wait (1) secs
 change [Double XP v] by (-1)
 if <(Double XP) = (0)>
  hide variable [Double XP v]
 end

To make things easier, you'll want to change it to this:
when gf clicked
set [Double XP v] to (0)
when gf clicked
show variable [double XP v]
set [Double XP v] to (10)
repeat until <(Double XP) = (0)>
 wait (1) secs
 change [Double XP v] by (-1) 
 if <(Double XP) = (0)>
  hide variable [Double XP v]
 end
end

Also, in your food sprites, you have a lot of these scripts:

when I receive [doubleXP! v]
forever
 if <(touching [sprite1 v]?) and <(Double XP) = (1)>>
  broadcast [xpBurger! v]
 end

Well, with the code I'm about to give you, you can get rid of every single one of those.

Now, in your character, you have score scripts, one of which is:

when I receive [eatenHOTDOG! v]
change [score v] by (100)

Instead, try using this:

when I receive [eatenHOTDOG! v]
if <(Double XP) > (0)>
 change [score v] by (200)
else
 change [score v] by (100)
end

I hope that this helps!

Last edited by ErnieParke (2013-01-19 12:48:30)


http://i46.tinypic.com/35ismmc.png

Offline

 

#6 2013-01-19 13:17:12

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

Can you please upload your version of my game with the scripts you changed? I'm really struggling  sad

-Thanks :3

Offline

 

#7 2013-01-19 13:23:28

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

Never-mind, it's sorted  smile  Many thanks!!!!!!!!!!!!!!!!

Offline

 

#8 2013-01-19 13:25:57

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Jakekerrigan wrote:

Never-mind, it's sorted  smile  Many thanks!!!!!!!!!!!!!!!!

Your welcome! Also, I should've said this earlier, but hello Jakekerrigan and welcome to Scratch! I wish you good luck with your game!  smile


http://i46.tinypic.com/35ismmc.png

Offline

 

#9 2013-01-19 13:35:59

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

Thanks! There is just one problem however. When I start the game and pickup a double xp powerup, the timer doesn't appear. I messed about with some scripts, and now the timer just begins right at the beginning?

Offline

 

#10 2013-01-19 13:51:22

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Jakekerrigan wrote:

Thanks! There is just one problem however. When I start the game and pickup a double xp powerup, the timer doesn't appear. I messed about with some scripts, and now the timer just begins right at the beginning?

Could you reupload your project? I think that something went wrong when you were messing around with your scripts.


http://i46.tinypic.com/35ismmc.png

Offline

 

#11 2013-01-19 13:54:59

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

http://scratch.mit.edu/projects/Jakekerrigan/3047952

Thanks for all your help  smile

Offline

 

#12 2013-01-19 14:04:23

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Jakekerrigan wrote:

http://scratch.mit.edu/projects/Jakekerrigan/3047952

Thanks for all your help  smile

Ah, okay, I see the problem now. When I was giving you the script for the Double XP sprite, I forgot to change the hat block. So, what you have is:

when gf clicked
show variable [double XP v]
set [Double XP v] to (10)
repeat until <(Double XP) = (0)>
 wait (1) secs
 change [Double XP v] by (-1) 
 if <(Double XP) = (0)>
  hide variable [Double XP v]
 end
end

What you'll need is:

when I receive [doubleXP! v]//Hopefully correct broadcast...
show variable [double XP v]
set [Double XP v] to (10)
repeat until <(Double XP) = (0)>
 wait (1) secs
 change [Double XP v] by (-1) 
 if <(Double XP) = (0)>
  hide variable [Double XP v]
 end
end


http://i46.tinypic.com/35ismmc.png

Offline

 

#13 2013-01-19 14:06:30

Jakekerrigan
New Scratcher
Registered: 2013-01-09
Posts: 10

Re: Help Please!

Everything is fixed! Thanks!

Offline

 

#14 2013-01-19 14:43:42

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Jakekerrigan wrote:

Everything is fixed! Thanks!

You're welcome!


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer