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

#1 2012-07-30 00:32:24

jono3814
New Scratcher
Registered: 2012-07-18
Posts: 17

Please help..

Iv made a game that at the end of each level you reach a portal that takes you to the next round. My first portal works but my second one doesn't and they roughly have the same scripts. When the enemy dies the portal is supposed to appear and move up and down on the y axsis to make like its floating. What happens is when the enemy dies the portal appears but doesn't move up and down on the y axsis, you can go into it and go to the next round but what happens is that the portal stays there and doesn't hide... Iv tried shrinking it changing its costume to a dot but all it does is constantly appears and dissappears. Can some help?

Here's the code I used:
When I receice (dead)
Show
Set (Xpos) to -40
Set (x1) to 0
Forever
Go to x: scrollx + 480*0+5 y:Xpos
Change (x1) by 1
Set (x2) to (sin of x1)
Change (Xpos) by (x2)
If ( touching sprite1)
Set scrollx to 0
Bradcast level 3 intro
Wait 1.5 secs

Offline

 

#2 2012-07-31 07:49:40

SimplyMelee
Scratcher
Registered: 2012-01-14
Posts: 100+

Re: Please help..

As a coincidence I was helping someone do a project like yours, maybe you should use this to help you...
http://scratch.mit.edu/projects/SimplyMelee/2702756

hope it helped!


http://oi48.tinypic.com/2czzjol.jpg

Offline

 

#3 2012-07-31 08:15:07

EPICPIKAGUY
Scratcher
Registered: 2011-05-17
Posts: 22

Re: Please help..

jono3814Iv made a game that at the end of each level you reach a portal that takes you to the next round. My first portal works but my second one doesn't and they roughly have the same scripts. When the enemy dies the portal is supposed to appear and move up and down on the y axsis to make like its floating. What happens is when the enemy dies the portal appears but doesn't move up and down on the y axsis, you can go into it and go to the next round but what happens is that the portal stays there and doesn't hide... Iv tried shrinking it changing its costume to a dot but all it does is constantly appears and dissappears. Can some help?

Here's the code I used:
When I receice (dead)
Show
Set (ypos) to -40
Set (x1) to 0
Forever
Go to x: scrollx + 480*0+5 y:Xpos
Change (x1) by 1
Set (x2) to (sin of x1)
Change (Xpos) by (x2)
If ( touching sprite1)
Set scrollx to 0
Bradcast level 3 intro
Wait 1.5 secs wrote:

here... you need to make it Y axis,for one.


 When I receice (dead)
Show
Set (Xpos) to -40
Set (x1) to 0
Forever 
Go to x: scrollx + 480*0+5 y:Xpos
Change (y1) by 1
Set (y2) to (sin of y1)
Change (ypos) by (y2)
If ( touching sprite1)
Set scrollx to 0
Bradcast level 3 intro
Wait 1.5 secs


file:///C:/Documents%20and%20Settings/Ethan/Desktop/798330_sm.gif

Offline

 

#4 2012-08-02 15:33:37

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

Re: Please help..

EPICPIKAGUY wrote:

jono3814Iv made a game that at the end of each level you reach a portal that takes you to the next round. My first portal works but my second one doesn't and they roughly have the same scripts. When the enemy dies the portal is supposed to appear and move up and down on the y axsis to make like its floating. What happens is when the enemy dies the portal appears but doesn't move up and down on the y axsis, you can go into it and go to the next round but what happens is that the portal stays there and doesn't hide... Iv tried shrinking it changing its costume to a dot but all it does is constantly appears and dissappears. Can some help?

Here's the code I used:
When I receice (dead)
Show
Set (ypos) to -40
Set (x1) to 0
Forever
Go to x: scrollx + 480*0+5 y:Xpos
Change (x1) by 1
Set (x2) to (sin of x1)
Change (Xpos) by (x2)
If ( touching sprite1)
Set scrollx to 0
Bradcast level 3 intro
Wait 1.5 secs wrote:

here... you need to make it Y axis,for one.


 When I receice (dead)
Show
Set (Xpos) to -40
Set (x1) to 0
Forever 
 Go to x: scrollx + 480*0+5 y:Xpos
 Change (y1) by 1
 Set (y2) to (sin of y1)
 Change (ypos) by (y2)
 If ( touching sprite1)
  Set scrollx to 0
  Bradcast level 3 intro
  Wait 1.5 secs
 End

Fixed your script:

 When I receive [dead v]
Show
Set (Xpos) to (-40)
Set (x1) to (0)
Forever 
 Go to x: ( scrollx + 480*0+5) y: (Xpos)
 Change (y1) by (1)
 Set (y2) to (sin of (y1))
 Change (ypos) by (y2)
 If <touching [sprite1 v]?>
  Set (scrollx) to (0)
  Broadcast [level 3 intro v]
  Wait (1.5) secs
 End

Last edited by ErnieParke (2012-08-02 15:37:14)


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

Offline

 

Board footer