> global theXcoord, theYcoord, mapXcoord, mapYcoord, > lastXPosition, lastYposition on preOpenCard > put 550 into mapYcoord > put 412 into mapXcoord > set the loc of image "GeminiStation.jpg" to > mapXcoord,mapYcoord end preOpenCard
if your script is really like this > lastXPosition, lastYposition on preOpenCard and not the result of a copy paste error then your preopencard handler is ignored because it is not the start of the line. The script looks fine without testing it. Can you furnish the stack ;)?? X > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Judy Perry > Sent: Friday, November 12, 2004 22:30 > To: How to use Revolution > Subject: Stumped & Feeling Stupid... > > I'm trying to create a simple sidescroller game example. I > have a stack containing a single card containing two images: > > (1) "map" image that is larger than card window (it's a > starcraft map). > (2) animated gif of player/critter that can be moved about > screen using the arrow keys. > > The map is more or less scrollable by using global variables > to reset its position when the critter intersects with > transparent buttons on the card's edges (incomplete but > working acceptably so far). The location of the critter is > also kept via global variables. > > Among other things, I'm trying to test for the critter > hitting an obstacle such that s/he/it can't "go" certain > places (which I'll call > "Obstacle1.gif") > > I'm trying to keep track of the lastXposition and > lastYposition via global variables but it doesn't seem to be > working in terms of constraining the critter's movement; I've > checked the variable watcher and, indeed, the globals for > lastXposition and lastYposition aren't changing in value, but > the critter's location is, even though it is set to > lastXposition,lastYposition. > > Any ideas? Script is below... > > Thank you for any ideas anyone can offer! > > Judy > > global theXcoord, theYcoord, mapXcoord, mapYcoord, > lastXPosition, lastYposition on preOpenCard > put 550 into mapYcoord > put 412 into mapXcoord > set the loc of image "GeminiStation.jpg" to > mapXcoord,mapYcoord end preOpenCard > > > on openCard > put "80" into theXcoord > put "80" into lastXposition > put "155" into theYcoord > put "155" into lastYposition > set the loc of image "Lurker.gif" to theXcoord,theYcoord > > end openCard > > on arrowKey tKey > switch tKey > case "left" > subtract "7" from theXcoord > put (theXcoord + 7) into lastXposition > break > case "right" > add 7 to theXcoord > put (theXcoord - 7) into lastXposition > break > case "up" > subtract 7 from theYcoord > put (theYcoord + 7) into lastYposition > break > case "down" > add 7 to theYcoord > put (theYcoord - 7) into lastYposition > break > end switch > obstacleDetect > set the loc of image "Lurker.gif" to theXcoord,theYcoord > edgeDetect > > end arrowKey > > on edgeDetect > if the intersect (image "Lurker.gif",button "RightEdge") then > subtract 13 from mapXCoord > set the loc of image "GeminiStation.jpg" to mapXcoord,mapYcoord > end if > if the intersect (image "Lurker.gif",button "BottomEdge") then > subtract 13 from mapYcoord > set the loc of image "GeminiStation.jpg" to mapXcoord,mapYcoord > end if > if the intersect (image "Lurker.gif",button "Corner") then > subtract 13 from mapXcoord > subtract 13 from mapYcoord > set the loc of image "GeminiStation.jpg" to mapXcoord,mapYcoord > end if > > > end edgeDetect > > on obstacleDetect > --repeat for i = 1 to 10 > if the intersect (image "Lurker.gif",image "Obstacle1.gif") then > beep > set the loc of image "Lurker.gif" to lastXposition,lastYposition > end if > > end obstacleDetect > > > > _______________________________________________ > use-revolution mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/use-revolution > _______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
