Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!strath-cs!cs.glasgow.ac.uk!kww From: kww@cs.glasgow.ac.uk (Dr Kevin Waite) Newsgroups: comp.lang.smalltalk Subject: Montana Game Bug Fix Message-ID: <7106@vanuata.cs.glasgow.ac.uk> Date: 3 Dec 90 09:41:32 GMT Organization: Computing Sci, Glasgow Univ, Scotland Lines: 50 Several people have mailed me saying that the code for the Montana game is incomplete. It is actually missing a method follow:while:within:. I did post this last week but it looks as if news is a bit flakey getting out of here. The simplest solution is to use the method follow:while: instead (i.e. just delete the third selector/argument to follow:while:within: in the method animateCardFrom:to: in MontanaView). For those of you who would prefer the code, it is given below. Sorry about all this. Cheers, Kevin -------------------------- C U T H E R E ------------------ 'From Smalltalk-80, Version 2.2 of July 4, 1987 on 9 October 1989 at 1:14:31 pm'! !DisplayObject methodsFor: 'screen'! follow: locationBlock while: durationBlock within: aRect "This method moves an image around on the Display. It restores the background continuously without causing flashing. LocationBlock supplies each new location, and durationBlock supplies true to continue, and then false to stop." "See (or run) OpaqueForm example." | location background | location _ locationBlock value. background _ self backgroundAt: location. self displayOn: Display at: location clippingBox: aRect. [durationBlock value] whileTrue: [location _ locationBlock value. (aRect containsPoint: location) ifTrue: [ self moveTo: location restoring: background clipBox: aRect] ]. background display! -------------------------------- C U T H E R E ----------------------------- -- Email: kww@uk.ac.glasgow.cs (JANET) kww%cs.glasgow.ac.uk@nsfnet-relay.ac.uk (INTERNET) Address: Dept. of Computing Science, University of Glasgow, 17 Lilybank Gardens, Glasgow, United Kingdom. G12 8QQ Brought to you by Super Global Mega Corp .com