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

#1 2013-02-21 22:52:43

Jb4R33lZ
New Scratcher
Registered: 2013-02-21
Posts: 3

Help with game

Hi everybody
I am new to scratch, and am creating a game. i want to make it like a tower defense game, but every time I shoot the sprite that I want to make disappear, it just starts flickers and keeps Moving. Also, is there any way I can make it so that the sprite only appears on certain levels? Any help will be greatly appreciated.

Offline

 

#2 2013-02-21 22:54:48

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Help with game

Jb4R33lZ wrote:

Hi everybody
I am new to scratch, and am creating a game. i want to make it like a tower defense game, but every time I shoot the sprite that I want to make disappear, it just starts flickers and keeps Moving. Also, is there any way I can make it so that the sprite only appears on certain levels? Any help will be greatly appreciated.

Could you post your scripts? That would make it much easier to trouble shoot.

Regards,

CAA14

Offline

 

#3 2013-02-21 23:04:12

Jb4R33lZ
New Scratcher
Registered: 2013-02-21
Posts: 3

Re: Help with game

This is what I started with for the sprite that I want to make disappear.

[scratchblocks]
when gf clicked
forever
  if <touching bullet 1>
  hide
[scratchblocks]

[scratchblocks]
when I receive <training>
forever
   hide
[scratchblocks]

And

[scratchblocks]
when I receive <level 1>
Forever
  show
[scratchblocks]

Offline

 

#4 2013-02-21 23:18:03

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Help with game

Jb4R33lZ wrote:

This is what I started with for the sprite that I want to make disappear.

when gf clicked
forever
  if <touching? [bullet 1 v]>
  hide
end
end
when I receive [training v]
forever 
hide
end
end
And

when I receive [level 1 v]
forever
show
end

Fixed.  smile

Okay, here's the problem:

when I receive [level 1 v]
forever
show
end
The forever loop is never breaking, so there are 2 forever loops trying to do opposite things at the same time, thus the flickering.

To fix this, do this:

when gf clicked
forever
 if <touching? [bullet 1 v]>
 hide
end
end
when I receive [training v]
forever  // I do not understand what this is for, so i can't suggest anything yet.
hide
end
when I receive [level 1 v]
forever
if <not <touching? [bullet 1 v]>>
show
end
end
Hope that helps,
If it doesn't please tell me and i will try something else.

CAA14

Offline

 

#5 2013-02-21 23:25:29

Jb4R33lZ
New Scratcher
Registered: 2013-02-21
Posts: 3

Re: Help with game

Thank you that helped. Now i need help in which i can make this script appear on different levels. You have been a great help CAA14 thaknks

Offline

 

#6 2013-02-22 11:25:48

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Help with game

Jb4R33lZ wrote:

Thank you that helped. Now i need help in which i can make this script appear on different levels. You have been a great help CAA14 thaknks

No problem, glad i could help.  smile

Now, about your levels, could you post your scripts? I don't want to mess something up by suggesting something that would mess something up that's already in your scripts.

The idea is that there's a variable called "level", and if that level is = to 1, then the sprite/background "level 1" appears, and the other levels do not.

Hope that helps,
If you don't understand, just ask and i will go into more detail.

CAA14

Offline

 

Board footer