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
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!
Offline
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
Offline
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)
Offline