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

#1 2013-01-28 14:49:24

EdgeGamer
Scratcher
Registered: 2012-07-04
Posts: 100+

I dont knwow what the problem is

So in my game script, after you beat the first puzzle and the cutscenes are over and everything, a hidden variable is set to 'true' (showing that it is over). I have a script ready so that the arrows that let you go to other locations only work when it's over. Howvever, when it's over, I click an arrow and the 'area' variable gloes blank and then nothing happens. Can anybody check and fix my scripts to make it so that when I click the right arrow the area variable is set to hills? The game is called DONT PLAY - Scratch Cat Detective or something like that, I cant remember the bit at the beggining.

Last edited by EdgeGamer (2013-01-28 14:50:30)


http://blocks.scratchr.org/API.php?user=EdgeGamer&action=onlineStatus&onlinehttp://i46.tinypic.com/jjpkeg.gif&offline=http://i49.tinypic.com/2mg05ki.gif

Offline

 

#2 2013-01-28 15:44:38

dechan
Scratcher
Registered: 2012-12-20
Posts: 69

Re: I dont knwow what the problem is

After surveying your script it was easy to determine your problem.
You are displaying the Up and Left arrow sprites after the first puzzle is solved.
The variables in play are then:
Area = "Southern Beach"
BSO = true

In the left arrow sprite here's the block of code:

when [Left v] clicked 
end
  if < (BSO) = [True] >
    if < (Area) = [Southern Beach] > // this is true
    set [Area v] to [Hills] // Area now = Hills
    end
    if < (Area) = [Northern Beach] >
    set [Area v] to [ ]
    end
    if < (Area) = [Hills] > // Then this is true
    set [Area v] to [ ]  // and immediately sets Area to empty
    end
    if < (Area) = [West Road] >
    set [Area v] to [ ]
    end
    if < (Area) = [Canyon] >
    set [Area v] to [ ]
    end
    if < (Area) = [Cornelius' Pathway] >
    set [Area v] to [Canyon]
    end
end

Last edited by dechan (2013-01-28 16:02:11)

Offline

 

#3 2013-01-28 16:59:33

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

Re: I dont knwow what the problem is

oh, yeah, that would mess up the game alright...
Does it work now, EdgeGamer?

Regards,


CAA14

Offline

 

#4 2013-01-31 16:55:35

EdgeGamer
Scratcher
Registered: 2012-07-04
Posts: 100+

Re: I dont knwow what the problem is

Thanks for the help. My PC had to get wiped so I'll see to getting Scratch later. Off topic but, did you guys magae to do the first puzzle or just look at scripts?


http://blocks.scratchr.org/API.php?user=EdgeGamer&amp;action=onlineStatus&amp;onlinehttp://i46.tinypic.com/jjpkeg.gif&amp;offline=http://i49.tinypic.com/2mg05ki.gif

Offline

 

#5 2013-01-31 17:05:00

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

Re: I dont knwow what the problem is

Well, i just looked now, and i don't think you have a ton of bugs.
I think it's just that you didn't finish it.
Like dechan said, you have some empty assignment boxes that need to be filled.
Very clever puzzle.  smile
i love those puzzles, reminds me of the moron test app.  smile

Hope that helps,

CAA14

Offline

 

#6 2013-02-01 18:32:41

EdgeGamer
Scratcher
Registered: 2012-07-04
Posts: 100+

Re: I dont knwow what the problem is

dechan wrote:

After surveying your script it was easy to determine your problem.
You are displaying the Up and Left arrow sprites after the first puzzle is solved.
The variables in play are then:
Area = "Southern Beach"
BSO = true

In the left arrow sprite here's the block of code:

when [Left v] clicked 
end
  if < (BSO) = [True] >
    if < (Area) = [Southern Beach] > // this is true
    set [Area v] to [Hills] // Area now = Hills
    end
    if < (Area) = [Northern Beach] >
    set [Area v] to [ ]
    end
    if < (Area) = [Hills] > // Then this is true
    set [Area v] to [ ]  // and immediately sets Area to empty
    end
    if < (Area) = [West Road] >
    set [Area v] to [ ]
    end
    if < (Area) = [Canyon] >
    set [Area v] to [ ]
    end
    if < (Area) = [Cornelius' Pathway] >
    set [Area v] to [Canyon]
    end
end

Well, what I was going for, was that it picks one of those 'ifs' depending on the area, and the hills one was blank because it would be hidden then anyway. I think I know how to fix it.


http://blocks.scratchr.org/API.php?user=EdgeGamer&amp;action=onlineStatus&amp;onlinehttp://i46.tinypic.com/jjpkeg.gif&amp;offline=http://i49.tinypic.com/2mg05ki.gif

Offline

 

Board footer