diff options
| author | Michael <mr.michael.racz@gmail.com> | 2011-06-29 09:28:00 +0200 |
|---|---|---|
| committer | Michael <mr.michael.racz@gmail.com> | 2011-06-29 09:28:00 +0200 |
| commit | 53fa19472745e44d0854454d44f4963a7594bcf7 (patch) | |
| tree | 876ec887cabdea3aac1e00f890523c6a427f4374 /pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes | |
| parent | b77033dad8594796c2ecd2048f63c9fbc9c2df5a (diff) | |
| download | foop-master.tar.gz foop-master.tar.bz2 foop-master.zip | |
Diffstat (limited to 'pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes')
| -rw-r--r-- | pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes index a195d0c..2096417 100644 --- a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes +++ b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.changes | |||
| @@ -1 +1 @@ | |||
| 'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 17 April 2010 at 5:22:05 pm'! ----STARTUP----{17 April 2010 . 5:21:54 pm} as C:\Squeak\4.0\4.1-final\Squeak4.1.image! Smalltalk appendChangesTo: 'SqueakV41.sources'.! ----QUIT----{17 April 2010 . 5:22:11 pm} Squeak4.1.image priorSource: 89! ----STARTUP----{18 April 2010 . 5:57:27 pm} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! !BlockContextTest methodsFor: 'running' stamp: 'md 9/6/2005 19:56' prior: 50431957! setUp super setUp. aBlockContext := [100@100 corner: 200@200]. contextOfaBlockContext := thisContext.! ! !BehaviorTest methodsFor: 'tests' stamp: 'md 2/18/2006 16:42' prior: 17365994! testBinding self assert: Object binding value = Object. self assert: Object binding key = #Object. self assert: Object class binding value = Object class. "returns nil for Metaclasses... like Encoder>>#associationFor:" self assert: Object class binding key = nil.! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53956757! testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #EmbeddedSourceQCompress ). self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer sourceCode: code. self assert: (trailer kind == #EmbeddedSourceZip ). newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53957691! testEmbeddingTempNames | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer tempNames: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #TempsNamesQCompress ). self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer tempNames: code. self assert: (trailer kind == #TempsNamesZip ). newTrailer := trailer testEncoding. self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:17' prior: 53958613! testEncodingNoTrailer | trailer | trailer := CompiledMethodTrailer new. "by default it should be a no-trailer" self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:14' prior: 53959109! testEncodingSourcePointer | trailer | trailer := CompiledMethodTrailer new. CompiledMethod allInstancesDo: [:method | | ptr | trailer method: method. self assert: ( (ptr := method sourcePointer) == trailer sourcePointer). "the last bytecode index must be at 0" ptr ~= 0 ifTrue: [ self assert: (method endPC = trailer endPC) ]. ].! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53959564! testEncodingVarLengthSourcePointer | trailer newTrailer | trailer := CompiledMethodTrailer new. trailer sourcePointer: 1. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 1). trailer sourcePointer: 16r100000000000000. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 16r100000000000000). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53960108! testSourceByIdentifierEncoding | trailer id | trailer := CompiledMethodTrailer new. id := UUID new asString. trailer sourceIdentifier: id. self assert: (trailer kind == #SourceByStringIdentifier ). trailer := trailer testEncoding. self assert: (trailer kind == #SourceByStringIdentifier ). self assert: (trailer sourceIdentifier = id). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:49' prior: 53960643! testSourceBySelectorEncoding | trailer | trailer := CompiledMethodTrailer new. trailer setSourceBySelector. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CategorizerTest methodsFor: 'running' stamp: 'mtf 9/10/2007 10:10' prior: 18074036! setUp categorizer := Categorizer defaultList: #(a b c d e). categorizer classifyAll: #(a b c) under: 'abc'. categorizer addCategory: 'unreal'.! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074267! testClassifyNewElementNewCategory categorizer classify: #f under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') (''nice'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:18' prior: 18074541! testClassifyNewElementOldCategory categorizer classify: #f under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074806! testClassifyOldElementNewCategory categorizer classify: #e under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'') (''nice'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:54' prior: 18075078! testClassifyOldElementOldCategory categorizer classify: #e under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:22' prior: 18075341! testDefaultCategoryIsTransient "Test that category 'as yet unclassified' disapears when all it's elements are removed'" categorizer classifyAll: #(d e) under: #abc. self assert: categorizer printString = '(''abc'' a b c d e) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 15:15' prior: 18075669! testNullCategory "Test that category 'as yet unclassified' disapears when all it's elements are removed'" | aCategorizer | aCategorizer := Categorizer defaultList: #(). self assert: aCategorizer printString = '(''as yet unclassified'') '. self assert: aCategorizer categories = #('no messages'). aCategorizer classify: #a under: #b. self assert: aCategorizer printString = '(''b'' a) '. self assert: aCategorizer categories = #(b).! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18076194! testRemoveEmptyCategory categorizer removeCategory: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:55' prior: 18076430! testRemoveExistingElement categorizer removeElement: #a. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076673! testRemoveNonEmptyCategory self should: [categorizer removeCategory: #abc] raise: Error. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076950! testRemoveNonExistingCategory categorizer removeCategory: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18077203! testRemoveNonExistingElement categorizer removeElement: #f. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 14:49' prior: 18077451! testRemoveThenRename categorizer removeCategory: #unreal. categorizer renameCategory: #abc toBe: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''unreal'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:14' prior: 18077736! testUnchanged self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! "KernelTests"! !SMLoaderPlus commentStamp: 'btr 12/1/2006 15:16' prior: 0! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). It uses ToolBuilder to construct its window. You can open one with: SMLoaderPlus open Instance Variables categoriesToFilterIds: <OrderedCollection> The set of categories to filter the packages list. filters: <OrderedCollection> The set of filters to apply to the packages list. map: <SMSqueakMap> The model SqueakMap. packagesList: <OrderedCollection> The list of packages from the map. selectedCategory: <SMCategory> The current category. selectedItem: <SMPackage> The selected package or release. window: <PluggableSystemWindow> The window, held only so we can reOpen.! !SMLoaderCategoricalPlus commentStamp: 'btr 12/4/2006 15:47' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategoricalPlus open! !SMLoader commentStamp: 'btr 11/30/2006 18:00' prior: 27913009! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). You can open one with: SMLoader open! !SMLoaderCategorical commentStamp: 'btr 12/1/2006 15:16' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategorical open! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifPresent: [:tb | (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:50'! buildFancyWith: aBuilder "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)); yourself); add: ((self buildNotInstalledPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ (horizDivide / 2)); yourself); add: ((self buildInstalledPackagesListWith: builder) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide); yourself); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1); yourself); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. self setUpdatablePanesFrom: #(#installedPackageList #notInstalledPackageList ). currentPackageList := #notInstalled. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:56'! buildInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #installedPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:52'! buildNotInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #notInstalledPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:55'! buildWith: aBuilder | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight))); add: ((self buildPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide)); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1)); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList ^currentPackageList! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:55'! defaultLabel ^ 'Categorical ' , super defaultLabel! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:52'! installedPackageList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! installedPackagesListIndex ^ self currentPackageList = #installed ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! isOn ^false! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:53'! notInstalledPackageList ^self packageList reject: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! notInstalledPackagesListIndex ^ self currentPackageList = #notInstalled ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:03'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategoricalPlus methodsFor: 'private' stamp: 'btr 12/1/2006 17:53'! noteChanged self changed: #installedPackageList. self changed: #notInstalledPackageList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:34'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! !SMLoaderPlus class methodsFor: 'parts bin' stamp: 'btr 11/22/2006 15:02'! descriptionForPartsBin ^self partName: 'Package Loader' categories: #(Tools) documentation: 'SqueakMap UI' ! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47'! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifPresent: [:tb | self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white "not set" ifTrue: [ Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor) ]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! initializedInstance ^ (ToolBuilder open: self new) extent: 400@400! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! new "Create a SqueakMap loader on the default map." ^self newOn: SMSqueakMap default! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! newOn: aMap "Create a SqueakMap loader on given map." ^super new on: aMap; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! newStandAlone ^ ToolBuilder open: self new! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:13'! open "Create and open a SqueakMap Loader." "SMLoaderPlus open" ^ (Smalltalk at: #ToolBuilder) open: self new! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:21'! openOn: aSqueakMap "Create and open a SqueakMap Loader on a given map." "self openOn: SqueakMap default" ^ (Smalltalk at: #ToolBuilder) open: (self newOn: aSqueakMap)! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:18'! prototypicalToolWindow ^ ToolBuilder open: self new; applyModelExtent; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:02'! registerInFlapsRegistry "Register the receiver in the system's flaps registry." self environment at: #Flaps ifPresent: [:cl | (cl respondsTo: #registerQuad:forFlapNamed:) ifTrue: [cl registerQuad: #(#SMLoader #prototypicalToolWindow 'Package Loader' 'The SqueakMap Package Loader' ) forFlapNamed: 'Tools']]! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoaderPlus class methodsFor: 'window color' stamp: 'btr 11/22/2006 15:02'! windowColorSpecification "Answer a WindowColorSpec object that declares my preference." ^WindowColorSpec classSymbol: self name wording: 'Package Loader' brightColor: Color yellow muchLighter duller pastelColor: Color yellow veryMuchLighter duller helpMessage: 'The SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! addSelectedCategoryAsFilter "Add a new filter that filters on the currently selected category. Make it enabled as default." categoriesToFilterIds add: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 16:11'! askToLoadUpdates "Check how old the map is and ask to update it if it is older than 10 days or if there is no map on disk." | available | available := map isCheckpointAvailable. (available not or: [ (Date today subtractDate: (Date fromSeconds: (map directory directoryEntryFor: map lastCheckpointFilename) modificationTime)) > 3]) ifTrue: [ (self confirm: (available ifTrue: ['The map on disk is more than 10 days old, update it from the Internet?'] ifFalse: ['There is no map on disk, fetch it from the Internet?'])) ifTrue: [self loadUpdates]]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:43'! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. dir := item isPackage ifTrue: [map cache directoryForPackage: item] ifFalse: [map cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. "withLabel: item name, ' cache directory'." win openInWorld! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildButtonBarWith: aBuilder ^ aBuilder pluggablePanelSpec new model: self; layout: #horizontal; children: (self commandSpecs select: [ :spec | spec fourth includes: #all] thenCollect: [ :spec | aBuilder pluggableActionButtonSpec new model: self; label: spec first; action: spec second; help: spec third; enabled: ((spec fourth includes: #item) ifTrue: [#hasSelectedItem]); yourself]); name: #buttonBar; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildCategoriesListWith: aBuilder "Create the hierarchical list holding the category tree." ^ aBuilder pluggableTreeSpec new model: self; roots: #categoryList; getSelectedPath: #selectedCategoryPath; getChildren: #categoryChildren:; hasChildren: #categoryHasChildren:; setSelected: #selectedCategory:; menu: #categoriesMenu:; label: #categoryLabel:; autoDeselect: true; wantsDrop: true; name: #categoriesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagePaneWith: aBuilder "Create the text area to the right in the loader." ^ aBuilder pluggableTextSpec new model: self; getText: #itemDescription; name: #packagePane; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagesListWith: aBuilder "Create the hierarchical list holding the packages and releases." ^ aBuilder pluggableTreeSpec new model: self; roots: #packageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; name: #packagesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildSearchPaneWith: aBuilder ^ aBuilder pluggableInputFieldSpec new model: self; selection: #searchSelection; getText: #searchText; setText: #findPackage:notifying:; name: #search; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:54'! buildWith: aBuilder "Create the package loader window." | buttonBarHeight vertDivide horizDivide | buttonBarHeight := 0.07. vertDivide := 0.6. horizDivide := 0.3. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight)); add: ((self buildSearchPaneWith: builder) frame: (0 @ buttonBarHeight corner: horizDivide @ (buttonBarHeight * 2))); add: ((self buildPackagesListWith: builder) frame: (0 @ (buttonBarHeight * 2) corner: horizDivide @ vertDivide)); add: ((self buildCategoriesListWith: builder) frame: (0 @ vertDivide corner: horizDivide @ 1)); add: ((self buildPackagePaneWith: builder) frame: (horizDivide @ buttonBarHeight corner: 1 @ 1)); yourself); yourself). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! cachePackageReleaseAndOfferToCopy "Cache package release, then offer to copy it somewhere. Answer the chosen file's location after copy, or the cache location if no directory was chosen." | release installer newDir newName newFile oldFile oldName | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. installer := SMInstaller forPackageRelease: release. [UIManager default informUser: 'Caching ' , release asString during: [installer cache]] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs. ^nil ]. installer isCached ifFalse: [self inform: 'Download failed, see transcript for details'. ^nil]. oldName := installer fullFileName. newDir := FileList2 modalFolderSelector: installer directory. newDir ifNil: [ ^oldName ]. newDir = installer directory ifTrue: [ ^oldName ]. newName := newDir fullNameFor: installer fileName. newFile := FileStream newFileNamed: newName. newFile ifNil: [ ^oldName ]. newFile binary. oldFile := FileStream readOnlyFileNamed: oldName. oldFile ifNil: [ ^nil ]. oldFile binary. [[ newDir copyFile: oldFile toFile: newFile ] ensure: [ oldFile close. newFile close ]] on: Error do: [ :ex | ^oldName ]. ^newName! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categoriesMenu: aMenu "Answer the categories-list menu." self selectedCategory ifNotNil: [aMenu addList: self categorySpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! categoryChildren: aCategory ^ aCategory subCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! categoryHasChildren: aCategory ^ aCategory hasSubCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:46'! categoryLabel: aCategory ^ aCategory name! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01'! categoryList "Create the category list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (map categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/22/2006 15:02'! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:01'! commandSpecFor: selector ^ self commandSpecs detect: [:spec | spec second = selector]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:00'! commandSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.' (item all)) ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.' (item all)) ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.' (item all)) ('Copy from cache' cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' (item)) ('Force download into cache' downloadPackageRelease 'Force a download of the selected release into the cache.' (item)) ('Update' loadUpdates 'Update the package index from the servers.' (all)) ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (conf8irming each).' (all)) ('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm '' (item)) ('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm '' (item)) ('Copy list' listInPasteBuffer 'Puts the list as text into the clipboard.' (all)) ('Save filters' saveFiltersAsDefault 'Saves the current filters as default.' (all)) ('Help' help 'What is this?' (all)))! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! defaultLabel ^ 'SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! downloadPackageRelease "Force a download of the selected package release into the cache." | release | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. [UIManager default informUser: 'Downloading ' , release asString during: [ (SMInstaller forPackageRelease: release) download] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterAdd: anObject self changeFilters: (self filters copyWith: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterAutoInstall ^[:package | package isInstallable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterAvailable ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterInstalled ^[:package | package isInstalled]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterNotInstalledYet ^[:package | package isInstalled not]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterNotUptoDate ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterPublished ^[:package | package isPublished]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterRemove: anObject self changeFilters: (self filters copyWithout: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterSafelyAvailable ^[:package | package isSafelyAvailable]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/30/2006 21:07'! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #(#('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.') ) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ' , (map object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterVersion "Ignore spaces in the version string, they're sometimes spurious. Not used anymore." ^[:package | package categories anySatisfy: [:cat | (cat name, '*') match: (Smalltalk version copyWithout: $ ) ]]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filters ^filters! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/24/2006 13:49'! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description. " | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^ self]. descriptions := self packageList collect: [:e | e description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 18:36'! hasSelectedItem ^ self selectedPackageOrRelease notNil! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by versions: (installed -> latest). If there is no arrow, your installed version of the package is the latest. Bold packages and releases have been installed. The checkbox menu items modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. Comment on a package by emailing the author or the squeak list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://wiki.squeak.org/2726' asUrl]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! informException: ex msg: msg "Tell the user that an error has occurred. Offer to open debug notifier." (self confirm: msg, 'Would you like to open a debugger?') ifTrue: [ex pass]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 05:28'! initialExtent ^500@400! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:53'! installPackageRelease: aRelease "Install a package release. The cache is used." | myRelease installer | aRelease isCompatibleWithCurrentSystemVersion ifFalse: [(self confirm: 'The package you are about to install is not listed as being compatible with your image version (', SystemVersion current majorMinorVersion, '), so the package may not work properly. Do you still want to proceed with the install?') ifFalse: [^ self]]. myRelease := self installedReleaseOfMe. installer := SMInstaller forPackageRelease: aRelease. [UIManager default informUser: 'Downloading ' , aRelease asString during: [installer download]. UIManager default informUser: 'Installing ' , aRelease asString during: [ installer install. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! installedReleaseOfMe "Return the release of the installed package loader." ^SMSqueakMap default installedReleaseOf: (SMSqueakMap default packageWithId: '941c0108-4039-4071-9863-a8d7d2b3d4a3').! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! itemChildren: anItem ^ anItem isPackage ifTrue: [anItem releases] ifFalse: [#()]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 19:56'! itemDescription ^ self selectedPackageOrRelease ifNil: ['<No package selected>'] ifNotNilDo: [:item | item fullDescription]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! itemHasChildren: anItem ^ anItem isPackage and: [anItem releases notEmpty]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! itemLabel: anItem | label | label := anItem isPackage ifTrue: [anItem name , (anItem versionLabel ifEmpty: [''] ifNotEmptyDo: [:lbl | ' (' , anItem versionLabel , ')'])] ifFalse: [anItem smartVersion]. ^ anItem isInstalled ifTrue: [label asText allBold] ifFalse: [label]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/24/2006 17:17'! label ^ self labelForShown: (packagesList ifNil: [self packageList])! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! labelForFilter: aFilterSymbol ^(self filterSpecs detect: [:fs | fs second = aFilterSymbol]) first! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! labelForShown: packagesShown "Update the label of the window." ^ self defaultLabel , ' (', (packagesShown size < map packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , map packages size printString, ' packages)'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! listInPasteBuffer "Useful when talking with people etc. Uses the map to produce a nice String." Clipboard clipboardText: (String streamContents: [:s | packagesList do: [:p | s nextPutAll: p nameWithVersionLabel; cr ]]) asText! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:31'! loadUpdates [UIManager default informUser: 'Loading Updates' during: [ map loadUpdates. self noteChanged ] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when updating map:\', ex messageText, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/24/2006 14:05'! noteChanged filters ifNil: [^ self reOpen]. map ifNotNil: [packagesList := nil. selectedCategory := nil. self changed: #categoryList. self changed: #packageList. self changed: #packagesListIndex. "update my selection" self contentsChanged]! ! !SMLoaderPlus methodsFor: 'initialization' stamp: 'btr 11/22/2006 16:11'! on: aSqueakMap "Initialize instance." map := aSqueakMap. map synchWithDisk. filters := DefaultFilters copy. categoriesToFilterIds := DefaultCategoriesToFilterIds copy. self askToLoadUpdates! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! package: aPackage filteredByCategory: aCategory "Answer true if the package should be shown if we filter on <aCategory>. It should be shown if itself or any of its releases has the category." | releases | releases := aPackage releases. ^(aPackage hasCategoryOrSubCategoryOf: aCategory) or: [ releases anySatisfy: [:rel | rel hasCategoryOrSubCategoryOf: aCategory]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list | list := packagesList ifNil: [packagesList := self packageListCalculated]. selectedCategory ifNotNil: [ list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^ list! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageListCalculated "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." ^ self packages select: [:p | filters allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [self package: p filteredByCategory: (map object: currFilter)]]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! packageNameList ^ self packageList collect: [:e | e name]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:30'! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: (self commandSpecFor: #installPackageRelease)]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: (self commandSpecFor: #browseCacheDirectory)]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: (self commandSpecFor: #cachePackageReleaseAndOfferToCopy). choices add: (self commandSpecFor: #downloadPackageRelease)]. choices add: (self commandSpecFor: #emailPackageMaintainers). ^ choices! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 16:11'! packages "We request the packages as sorted by name by default." ^map packagesByName asArray ! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex ^ self packageList indexOf: self selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex: anObject self selectedItem: (anObject = 0 ifFalse: [self packageList at: anObject])! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! packagesMenu: aMenu "Answer the packages-list menu." self selectedPackageOrRelease ifNotNil: [aMenu addList: self packageSpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:45'! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." ^ (self respondsTo: selector) ifTrue: [self perform: selector] ifFalse: [super perform: selector orSendTo: otherTarget]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/26/2006 23:22'! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. window delete. (Smalltalk at: self class name) open! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeCategoryFilters "Remove all category filters." categoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeSelectedCategoryAsFilter "Remove the filter that filters on the currently selected category." categoriesToFilterIds remove: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! saveFiltersAsDefault "Save the current filters as default so that they are selected the next time the loader is opened." DefaultFilters := filters copy. DefaultCategoriesToFilterIds := categoriesToFilterIds copy! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchSelection "Selects all of the default search text so that a type-in overwrites it." ^ {1. self searchText size}! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchText "A dummy default search text so that the field describes its purpose." ^ 'Search packages'! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedCategory "Return selected category." ^ selectedCategory! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:37'! selectedCategory: anSMCategory "Change the selected category." selectedCategory := anSMCategory. selectedCategory ifNotNil: [(selectedCategory objects includes: self selectedItem) ifFalse: [self selectedItem: nil]]. self changed: #selectedCategory. self changed: #packageList! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:52'! selectedCategoryPath "Return selected category's path." | path | path := #(). selectedCategory ifNotNil: [selectedCategory parent ifNotNilDo: [:p | path := path copyWith: p]. path := path copyWith: selectedCategory]. ^ path collect: [:cat | self categoryLabel: cat]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedItem ^ selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:27'! selectedItem: anItem "This == workaround protects us from recursion since ToolBuilder's tree widgets will always tell us that the selection has been updated when we tell it that the selection path has been updated. Cleaner solutions invited." anItem == selectedItem ifFalse: [ selectedItem := anItem. self changed: #selectedItemPath. self changed: #itemDescription. self changed: #hasSelectedItem]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:16'! selectedItemPath | path | path := #(). (selectedItem isKindOf: SMPackageRelease) ifTrue: [path := path copyWith: selectedItem package]. selectedItem ifNotNil: [path := path copyWith: selectedItem]. ^ path! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:03'! selectedPackageOrRelease "Return selected package or package release." ^ selectedItem! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! showFilterString: aFilterSymbol ^(self stateForFilter: aFilterSymbol), (self labelForFilter: aFilterSymbol)! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! stateForFilter: aFilterSymbol ^(self filters includes: aFilterSymbol) ifTrue: ['<yes>'] ifFalse: ['<no>'] ! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! toggleFilterState: aFilterSymbol ^(self filters includes: (aFilterSymbol)) ifTrue: [self filterRemove: aFilterSymbol] ifFalse: [self filterAdd: aFilterSymbol]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! uncheckFilters "Uncheck all filters." filters := OrderedCollection new. self noteChanged! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! updateLabel: packagesShown "Update the label of the window." window ifNotNilDo: [:w | w setLabel: (self labelForShown: packagesShown)]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [ map upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. Confirms on each upgrade." ^ self upgradeInstalledPackagesConfirm: true! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade. " | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [^ self inform: 'All ' , installed size printString , ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [^ self inform: 'None of the ' , old size printString , ' old packages of the ' , installed size printString , ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: ['Of the ' , old size printString , ' old packages only ' , toUpgrade size printString , ' can be upgraded. The following packages will not be upgraded: ' , (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info , ' About to upgrade the following packages: ' , (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]) , 'Proceed?') ifTrue: [myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [confirmEach ifTrue: [map upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ' , p installedRelease packageNameWithVersion , ' to ' , (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName , '?']] ifFalse: [map upgradeOldPackages]. self inform: toUpgrade size printString , ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifTrue: [self noteChanged] ifFalse: [self reOpen]]] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\' , ex messageText , '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesNoConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. No confirmation on each upgrade." ^ self upgradeInstalledPackagesConfirm: false! ! !SMPackageWrapper methodsFor: 'comparing' stamp: 'dvf 9/21/2003 16:25' prior: 27998626! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMPackageWrapper methodsFor: 'converting' stamp: 'btr 11/22/2006 00:54' prior: 27998778! asString | string | string := item name, ' (', item versionLabel, ')'. item isInstalled ifTrue: [string := string asText allBold]. "(string includesSubString: '->') ifTrue: [string := string asText color: Color green]." ^ string! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'dvf 10/14/2003 18:58' prior: 27998902! contents ^item releases reversed collect: [:e | SMPackageReleaseWrapper with: e]! ! !SMPackageWrapper methodsFor: 'testing' stamp: 'dvf 9/21/2003 16:25' prior: 27999070! hash ^self withoutListWrapper hash! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:55'! help ^ 'This shows all packages with their releases that should be displayed according the current filter.'! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString! ! !SMPackageWrapper methodsFor: 'printing' stamp: 'dvf 9/21/2003 16:22' prior: 27999192! printOn: aStream aStream nextPutAll: 'wrapper for: ', item printString! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849043! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMCategoryWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 18:53' prior: 27849195! asString ^ item name , ' (' , self numberOfObjects printString , ')'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'ar 2/9/2004 02:35' prior: 27849301! category ^item! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 21:02' prior: 27849402! contents ^ item subCategories collect: [:n | self class with: n model: n]! ! !SMCategoryWrapper methodsFor: 'model access' stamp: 'btr 11/30/2006 21:02'! getList ^ Array with: (self class with: self contents model: model)! ! !SMCategoryWrapper methodsFor: 'testing' stamp: 'btr 11/30/2006 18:53'! hasContents ^ item hasSubCategories! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849700! hash ^self withoutListWrapper hash! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:56'! help ^ 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'BJP 11/22/2002 14:17'! model ^model! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:53'! numberOfObjects " | total | total _ 0. model allCategoriesDo: [:c | total _ total + c objects size]. ^total" ^item objects size! ! !SMPackageReleaseWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 21:30' prior: 27997393! asString "Show installed releases with a trailing asterisk." | string | string := item smartVersion. "Older SMBase versions don't have isInstalled.'" (item respondsTo: #isInstalled) ifTrue: [item isInstalled ifTrue: [string := (string , ' *') asText allBold]]. ^ string! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 17:14'! contents ^ #()! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString ! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47' prior: 27944626! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifAbsent: [self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white ifTrue: ["not set" Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor)]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52' prior: 27945298! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:08' prior: 54331069! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:15' prior: 27927912! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. item ifNil: [^nil]. dir := item isPackage ifTrue: [model cache directoryForPackage: item] ifFalse: [model cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. " withLabel: item name, ' cache directory'." win openInWorld ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:52'! buildButtonBar | aRow btn | aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. self buttonSpecs do: [:spec | btn := self buildButtonNamed: spec first helpText: spec third action: spec second. aRow addMorphBack: btn] separatedBy: [aRow addTransparentSpacerOfSize: 3@0]. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:27'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 19:04' prior: 27928394! buildMorphicCategoriesList "Create the hierarchical list holding the category tree." | list | list := (SimpleHierarchicalListMorph on: self list: #categoryWrapperList selected: #selectedCategoryWrapper changeSelected: #selectedCategoryWrapper: menu: #categoriesMenu: keystroke: nil) autoDeselect: true; enableDrag: false; enableDrop: true; yourself. list setBalloonText: 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'. "list scroller submorphs do:[:each| list expandAll: each]." list adjustSubmorphPositions. ^ list! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:22' prior: 27929139! buildMorphicPackagesList "Create the hierarchical list holding the packages and releases." ^(SimpleHierarchicalListMorph on: self list: #packageWrapperList selected: #selectedItemWrapper changeSelected: #selectedItemWrapper: menu: #packagesMenu: keystroke: nil) autoDeselect: false; enableDrag: false; enableDrop: true; setBalloonText: 'This shows all packages with their releases that should be displayed according the current filter.'; yourself! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:13'! buildPackageButtonBar | aRow | "Somewhat patterned after IRCe's buttonRow method." aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'gk 5/5/2006 02:05' prior: 27929686! buildPackagePane "Create the text area to the right in the loader." | ptm | ptm := PluggableTextMorph on: self text: #contents accept: nil readSelection: nil "#packageSelection " menu: nil. ptm setBalloonText: 'This is where the selected package or package release is displayed.'. ptm lock. ^ptm! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:08' prior: 27930070! buildSearchPane "Cribbed from MessageNames>>inMorphicWindowWithInitialSearchString:" | typeInView searchButton typeInPane | typeInView := PluggableTextMorph on: self text: nil accept: #findPackage:notifying: readSelection: nil menu: nil. typeInView acceptOnCR: true; vResizing: #spaceFill; hResizing: #spaceFill; setTextMorphToSelectAllOnMouseEnter; askBeforeDiscardingEdits: false; setProperty: #alwaysAccept toValue: true. (typeInView respondsTo: #hideScrollBarsIndefinitely) ifTrue: [typeInView hideScrollBarsIndefinitely] ifFalse: [typeInView hideScrollBarIndefinitely]. searchButton := SimpleButtonMorph new target: typeInView; color: Color white; label: 'Search'; actionSelector: #accept; arguments: #(); yourself. typeInPane := AlignmentMorph newRow. typeInPane vResizing: #shrinkWrap; hResizing: #shrinkWrap; listDirection: #leftToRight; addMorphFront: searchButton; addTransparentSpacerOfSize: 6 @ 0; addMorphBack: typeInView; setBalloonText: 'Type into the pane, then press Search (or hit RETURN) to visit the next package matching what you typed.'. ^ typeInPane! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:24'! buttonSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.') ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.') ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.') ('Update' loadUpdates 'Update the package index from the servers.') ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (confirming each).') ('Help' help 'What is this?'))! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:11' prior: 27936393! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoader methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01' prior: 27933585! categoryWrapperList "Create the wrapper list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (model categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list collect: [:cat | SMCategoryWrapper with: cat model: self]! ! !SMLoader methodsFor: 'filter utilities' stamp: 'gk 7/10/2004 15:45' prior: 27913226! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 17:30' prior: 27930584! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.3. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0.0 @ 0.0 corner: 1.0 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0.0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (0.0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0.0 @ horizDivide corner: vertDivide @ 1.0). self addMorph: (self buildPackagePane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1.0 @ 1.0). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self! ! !SMLoader methodsFor: 'interface' stamp: 'gk 7/12/2004 11:14' prior: 27931214! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:01'! defaultLabel ^'SqueakMap Package Loader'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:14' prior: 27917579! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoader methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 00:14' prior: 27923782! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #( #('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.')) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ', (model object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 19:27' prior: 27918212! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description." | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^self]. descriptions := self packageWrapperList collect: [:e | e withoutListWrapper description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:05' prior: 27937041! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:48' prior: 27931447! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by (installed version -> latest version). If there is no arrow, your installed version of the package is the latest. Installed packages and releases are also in bold. The checkbox menu items at the bottom let you modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. If you like a package or have comments on it, please contact the author or the squeak mailing list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://minnow.cc.gatech.edu/squeak/2726' asUrl]! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:13' prior: 27918874! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoader methodsFor: 'actions' stamp: 'mist 8/17/2005 13:56'! installPackageWithDependents: package | myRelease | myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ package installWithDependencies. myRelease = self installedReleaseOfMe ifFalse: [self reOpen]. self noteChanged] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoader methodsFor: 'initialization' stamp: 'gk 4/5/2005 21:17' prior: 27932588! openAsMorph "Open the loader as a Morphic window." "SMLoader new openAsMorph" ^self createWindow openInWorld! ! !SMLoader methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45' prior: 27934165! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list selectedCategory | list := packagesList ifNil: [ packagesList := self packages select: [:p | (filters ifNil: [#()]) allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [ self package: p filteredByCategory: (model object: currFilter)]]]]. selectedCategoryWrapper ifNotNil: [selectedCategory := selectedCategoryWrapper category. list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^list! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/22/2006 14:30' prior: 27937451! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: self buttonSpecs first]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: self buttonSpecs third]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: #('Copy from cache' #cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' ). choices add: #('Force download into cache' #downloadPackageRelease 'Force a download of the selected release into the cache.' )]. choices add: self buttonSpecs second. ^ choices! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:56' prior: 27913703! packagesListIndex: anObject self selectedItemWrapper: (anObject ifNotNil: [anObject = 0 ifFalse: [self packageWrapperList at: anObject]])! ! !SMLoader methodsFor: 'interface' stamp: 'gk 4/5/2005 21:43' prior: 27932888! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." (self respondsTo: selector) ifTrue: [^ self perform: selector] ifFalse: [^ super perform: selector orSendTo: otherTarget]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/26/2006 23:22' prior: 27941030! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. self delete. (Smalltalk at: self class name) open! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 19:17' prior: 27913904! selectedCategory "Return selected category." ^selectedCategoryWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 12/1/2006 15:51' prior: 27914233! selectedCategoryWrapper: aWrapper selectedCategoryWrapper := aWrapper. (aWrapper notNil and: [aWrapper withoutListWrapper objects includes: selectedItemWrapper withoutListWrapper]) ifFalse: [self selectedItemWrapper: nil]. self changed: #selectedCategoryWrapper. self changed: #packageWrapperList.! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/22/2006 19:13' prior: 27914590! selectedItemWrapper: aWrapper selectedItemWrapper := aWrapper. self changed: #selectedItemWrapper. self contentsChanged! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:10' prior: 27941340! selectedPackageOrRelease "Return selected package or package release." ^self selectedItemWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:02' prior: 27935346! updateLabel: packagesShown "Update the label of the window." self setLabel: self defaultLabel , ' (', (packagesShown size < model packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , model packages size printString, ' packages)'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 21:03' prior: 27921197! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ model upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:03' prior: 27941568! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ confirmEach ifTrue: [ model upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ', p installedRelease packageNameWithVersion, ' to ', (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName, '?']] ifFalse: [model upgradeOldPackages]. self inform: toUpgrade size printString, ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifAbsent: [ (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #installedPackageNameList selected: #installedPackagesListIndex changeSelected: #installedPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicNotInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #notInstalledPackageNameList selected: #notInstalledPackagesListIndex changeSelected: #notInstalledPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createFancyWindow "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicNotInstalledPackagesList borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (horizDivide / 2)). self addMorph: (self buildMorphicInstalledPackagesList borderWidth: 0) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setUpdatablePanesFrom: #(#installedPackageNameList #notInstalledPackageNameList ). currentPackageList := #notInstalled. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide). self addMorph: (self buildSearchPane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 17:27'! currentPackageList ^currentPackageList! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'btr 11/30/2006 17:44'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! defaultLabel ^ 'SqueakMap Categorical Package Loader'! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! installedPackageNameList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! installedPackagesListIndex self currentPackageList = #installed ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 15:09'! isOn ^false! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! notInstalledPackageNameList ^self packageList select: [:e | e isInstalled not]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! notInstalledPackagesListIndex self currentPackageList = #notInstalled ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategorical methodsFor: 'private' stamp: 'btr 11/30/2006 20:21'! noteChanged self changed: #installedPackageNameList. self changed: #notInstalledPackageNameList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! SMLoader removeSelector: #paneColorOld! SMLoader removeSelector: #addPackagesTo:at:plus:! "SMLoader"! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! ----STARTUP----{19 April 2010 . 12:31:46 am} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! Smalltalk removeClassNamed: #MCMockClassC! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 59339410! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066043! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066175! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 57066304! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066431! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066565! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066689! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066783! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066859! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066935! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 57067021! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 57067115! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 57067217! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 57067420! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 57067488! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 57067587! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 23101866! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 57068777! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 57068888! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 59339563! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 57067679! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33645350! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645710! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645842! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33645971! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646098! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33646232! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646356! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646450! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646526! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646602! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33646688! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33646782! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33646884! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33647080! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33647148! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33647247! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33647351! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33647608! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33647869! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33648753! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33648927! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653416! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653555! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653766! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654029! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654165! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654418! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654514! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654737! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33654832! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655111! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655198! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33655388! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33656020! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656135! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33649269! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649629! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649761! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33649890! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650017! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33650151! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650275! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654610! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654309! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653921! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33650701! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33650803! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656527! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33650999! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33655542! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33656315! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33651270! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33651527! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33651788! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33652672! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33652846! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 57169526! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668453! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33668066! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668558! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33668861! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33668971! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669096! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33669221! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669331! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:32' prior: 24924985! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33669536! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669436! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669756! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669881! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669986! override ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33666466! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667021! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667137! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33667250! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667361! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667479! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667587! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667655! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667705! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667755! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33667815! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33667893! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33667979! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33668150! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33668192! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33668275! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33666736! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33666835! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33666930! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33666619! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33668351! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33670377! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670737! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670869! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33670998! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671125! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33671259! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671383! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671477! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671553! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671629! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33671715! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33671809! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33671911! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33672107! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33672175! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33672274! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33672378! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33672635! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33672896! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33673780! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33673954! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! Smalltalk removeClassNamed: #MCMockClassC! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678598! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678737! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33678948! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679211! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679347! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679600! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679696! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679919! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33680014! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680293! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680380! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33680570! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33681202! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681317! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33674296! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674656! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674788! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33674917! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675044! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33675178! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675302! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679792! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679491! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33679103! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33675728! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33675830! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681709! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33676026! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33680724! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33681497! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33676297! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33676554! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33676815! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33677699! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33677873! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33670091! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693635! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33693248! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693740! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694043! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694153! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694278! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694403! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694513! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:33' prior: 33669632! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33694718! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694618! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694938! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695063! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695168! override ^ 1! ! ----STARTUP----{29 April 2010 . 11:05:03 am} as /Users/bert/Downloads/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{29 April 2010 . 11:05:16 am} Squeak4.1.image priorSource: 229! ----STARTUP----{27 April 2011 . 11:47:16 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----SNAPSHOT----{27 April 2011 . 6:01:18 pm} Pacman.image priorSource: 229! ----QUIT----{27 April 2011 . 6:01:51 pm} Pacman.image priorSource: 141204! ----STARTUP----{27 April 2011 . 6:04:35 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Field instanceVariableNames:'' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Pacman instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! ----QUIT----{27 April 2011 . 7:38:58 pm} Squeak4.1.image priorSource: 141281! ----STARTUP----{27 April 2011 . 7:39:01 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT----{27 April 2011 . 8:19:22 pm} Squeak4.1.image priorSource: 142242! ----STARTUP----{28 April 2011 . 1:07:38 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields "Answer the value of fields" ^ fields! ! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields: anObject "Set the value of fields" fields := anObject! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:19'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:19'! setUpMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:27' prior: 33697668! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:27'! initializeMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:29' prior: 33698196! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:29'! fdf ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! PacmanServiceProvider removeSelector: #setUpMap! PacmanServiceProvider removeSelector: #initializeMap! PacmanServiceProvider removeSelector: #fdf! Smalltalk removeClassNamed: #PacmanServiceProvider! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:44'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:44'! initMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! Smalltalk removeClassNamed: #PacmanServiceProvider! !Map methodsFor: 'nil' stamp: 'abc 4/28/2011 13:59'! initMap self inform: 'Hello, World!!'. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 14:01' prior: 33699968! initMap self inform: 'Hello, World!!'.! ! Object subclass: #Map instanceVariableNames: 'fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:32' prior: 33700098! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:43' prior: 33700358! initMap self inform: 'Hello, World!!'. n := 50. m := 100. ^self.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:45' prior: 33700506! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! ----QUIT----{28 April 2011 . 11:54:29 pm} Squeak4.1.image priorSource: 142450! ----STARTUP----{29 April 2011 . 7:49:40 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 19:56' prior: 33700662! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:01'! initialize super initialize. self initMap.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:05' prior: 33701019! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:24'! main | m | m := Map new.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:25' prior: 33701337! initMap n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 4/29/2011 20:25' prior: 33701523! main | m | m := Map new. self inform: 'Hello, World!!'.! ! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! ----QUIT----{30 April 2011 . 12:40:44 am} Squeak4.1.image priorSource: 146293! ----STARTUP----{10 May 2011 . 11:55:01 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 11:56' prior: 33701823! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! main! main! ----SNAPSHOT----{10 May 2011 . 12:48:51 pm} Squeak4.1.image priorSource: 147520! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! main! main! self inform: 'Hello, World!!'.! ----QUIT/NOSAVE----{10 May 2011 . 12:50:26 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{10 May 2011 . 12:50:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! self inform: 'Hello, World!!'.! | m |! main! main! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 12:58' prior: 33702246! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:17' prior: 33702889! main | m | m := Map new. self inform: 'Hello, World!!'.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:18' prior: 33703043! main | m | m := Map new. self inform: 'Hello, World!!'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:20' prior: 33703190! main | m | m := Map new. self inform: 'Hello, World!!'. self inform: 'sthg other'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703368! main | m | m := Map new. self inform: 'done'. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703574! main | m | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703712! main | m form | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703886! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:25' prior: 33704067! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 10@10. self inform: 'done'. ! ! | m | m := Map new. m main. ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:26' prior: 33704296! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704580! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704833! main | m form | m := Map new. m initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! Morph subclass: #Game instanceVariableNames: 'form' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Morph subclass: #Game instanceVariableNames: 'form map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Game methodsFor: 'nil' stamp: 'abc 5/10/2011 14:34'! main "starting point of application" | temporary variable names | ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:35' prior: 33705581! main "starting point of application" map := Map new. map initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! Map removeSelector: #main! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:36' prior: 33705741! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:55' prior: 33706070! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'myGraphicsFileName') displayAt: 50@50. "self inform: 'done'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:57' prior: 33706372! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33706695! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33707040! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707387! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: '/home/michael/Desktop/guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707736! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708146! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708495! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "(Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:01' prior: 33708842! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:31' prior: 33709396! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:32' prior: 33709907! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! ----QUIT----{10 May 2011 . 9:33:43 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{11 May 2011 . 10:09:17 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: 'template fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'template fields x y' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:16' prior: 33701637! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711207! initMap "setting up the grid" x := 35. y := 17. "setting up template" "template = Array new: y. fields := Array new: y." fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711463! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'accessing' stamp: 'abc 5/11/2011 10:19' prior: 33697512! fields: anObject "Set the value of fields" fields := anObject! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33710291! main "starting point of application" "map := Map new. map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33712121! main "starting point of application" map := Map new. "map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:22' prior: 33711721! initMap "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:22' prior: 33712511! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33701205! initialize super initialize. self initMap. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33713503! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! Map removeSelector: #initMap! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:38' prior: 33713797! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33713117! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50 asMorph. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33715475! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." ((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33714148! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | Transcript show: j@i. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33716267! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | Transcript show: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:16' prior: 33717765! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | self inform: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:17' prior: 33719222! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33720675! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33722185! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33723763! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 50@50) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33725345! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:44' prior: 33727030! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:57' prior: 33728758! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:11' prior: 33730486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | template at: j - 1 at: i = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" (i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]. "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:12' prior: 33732822! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | ((template at: j - 1) at: i) = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:32' prior: 33735412! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType += 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType += 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:33' prior: 33738008! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType = blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType = blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:34' prior: 33740641! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:37' prior: 33743295! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((x-1)*16)@((y-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:38' prior: 33745992! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:40' prior: 33748777! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 13:40' prior: 33715830! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." "((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33751644! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33754790! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33757779! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:47' prior: 33760769! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:48' prior: 33763801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j <= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:49' prior: 33766833! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:51' prior: 33769999! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 14:01' prior: 33773247! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33776454! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33779649! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33782846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33786083! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:44' prior: 33789318! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:45' prior: 33792555! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:48' prior: 33795706! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= '#' ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:50' prior: 33798859! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:58' prior: 33801932! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank') asMorph. ]. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:00' prior: 33805001! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:01' prior: 33808109! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:03' prior: 33811262! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/black.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:16' prior: 33814460! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! ----QUIT----{12 May 2011 . 12:42:34 am} Squeak4.1.image priorSource: 156201! ----STARTUP----{15 May 2011 . 12:07:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:16' prior: 33817617! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:18' prior: 33821056! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33824352! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" "((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33827752! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33831225! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 50@300) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:33' prior: 33834737! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 0@0) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:43' prior: 33838211! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'nil' stamp: 'abc 5/15/2011 13:15'! renderPlayer: player x: x y: y "render player at a given coordinate"! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 13:22' prior: 33845368! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4.! ! Object subclass: #Map instanceVariableNames: 'template fields x y players' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:27' prior: 33841928! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33845919! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33849381! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:35' prior: 33852872! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:36' prior: 33856361! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:37' prior: 33859848! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33863337! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i) put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33866825! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:22' prior: 33870315! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33873803! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. pics at: 17 put: ''. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33877292! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:31' prior: 33880801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:34' prior: 33884288! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! Object subclass: #Map instanceVariableNames: 'template fields x y players points' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:37' prior: 33887775! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:39' prior: 33891470! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:41' prior: 33895119! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:42' prior: 33898834! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:43' prior: 33902579! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:46' prior: 33845567! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player show.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:48' prior: 33910119! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player openeWorld.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:50' prior: 33910377! renderPlayer: player x: x y: y "render player at a given coordinate" player drawOn: ((x-1)*16)+4@((y-1)*16)+4. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:52' prior: 33910600! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33910804! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player display.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33911075! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:54' prior: 33906285! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:55' prior: 33911565! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33915486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33919666! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:58'! redrawField: position "redraq part of the map" | temporary variable names | ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:08' prior: 33928011! redrawField: position "redraw part of the map" ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928180! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928361! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:12' prior: 33923846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: (35, 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:13' prior: 33928805! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:14' prior: 33928554! redrawField: position "redraw part of the map" ((fields at: (position at: 2)) at: (position at: 1)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33932972! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. "self redrawField: #(35 1)." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33937391! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:18' prior: 33937140! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:19' prior: 33945810! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). field imageForm display. (fields at: y) at: x put: field.! ! game := Game new.! | game | game := Game new. game main. ! Smalltalk removeClassNamed: #Wall! Smalltalk removeClassNamed: #EmptyField! Smalltalk removeClassNamed: #Field! | game | game := Game new. game main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/15/2011 18:13'! template "getter for template" ^template.! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 18:14' prior: 33754392! main "starting point of application" map := Map new. map initialize.! ! Smalltalk removeClassNamed: #Pacman! | game | game := Game new. game main. ! ----QUIT----{15 May 2011 . 6:40:23 pm} Squeak4.1.image priorSource: 266292! ----STARTUP----{16 May 2011 . 1:25:30 pm} as /home/manuel/uni/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{16 May 2011 . 1:25:47 pm} Squeak4.1.image priorSource: 392490! ----STARTUP----{16 May 2011 . 1:25:48 pm} as /home/manuel/uni/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{16 May 2011 . 1:30:07 pm} Squeak4.1.image priorSource: 392490! ----STARTUP----{24 May 2011 . 4:55:23 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 10 November 2006 at 6:07:42 pm'! Time now.! 3+4.! 3+4.! 3+4.! 3+4.! 3+4.! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 20 May 2011 at 2:14:41 pm'! ----End fileIn of a stream----! SimpleSwitchMorph subclass: #SBECell instanceVariableNames: 'mouseAction' classVariableNames: '' poolDictionaries: '' category: 'SBE-Quinto'! !SBECell methodsFor: 'nil' stamp: 'HD 5/24/2011 17:28'! initialize super initialize. self label: ''. self borderWidth: 2. bounds := 0@0 corner: 16@16. offColor := Color paleYellow. onColor := Color paleBlue darker. self useSquareCorners. self turnOff! ! SBECell new! self openInWorld! BorderedMorph subclass: #SBEGame instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SBE-Quinto'! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:36'! initialize | sampleCell width height n | super initialize. n := self cellsPerSide. sampleCell := SBECell new. width := sampleCell width. height := sampleCell height. self bounds: (5@5 extent: ((width*n) @(height *n)) + (2 * self borderWidth)). cells := Matrix new: n tabulate: [ :i :j | self newCellAt: i at: j ].! ! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:39'! cellsPerSide "The number of cells along each side of the game" ^10! ! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:39'! newCellAt: i at: j "Create a cell for position (i,j) and add it to my on--screen representation at the appropriate screen position. Answer the new cell" | c origin | c := SBECell new. origin := self innerBounds origin. self addMorph: c. c position: ((i -- 1) * c width) @ ((j -- 1) * c height) + origin. c mouseAction: [self toggleNeighboursOfCellAt: i at: j].! ! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:40'! toggleNeighboursOfCellAt: i at: j (i > 1) ifTrue: [ (cells at: i -- 1 at: j ) toggleState]. (i < self cellsPerSide) ifTrue: [ (cells at: i + 1 at: j) toggleState]. (j > 1) ifTrue: [ (cells at: i at: j -- 1) toggleState]. (j < self cellsPerSide) ifTrue: [ (cells at: i at: j + 1) toggleState].! ! !SBECell methodsFor: 'nil' stamp: 'HD 5/24/2011 17:41'! mouseAction: aBlock ^ mouseAction := aBlock! ! !SBECell methodsFor: 'nil' stamp: 'HD 5/24/2011 17:42'! mouseUp: anEvent mouseAction value! ! !SBEGame methodsFor: 'as yet unclassified' stamp: 'HD 5/24/2011 17:43' prior: 33949038! newCellAt: i at: j "Create a cell for position (i,j) and add it to my on--screen representation at the appropriate screen position. Answer the new cell" | c origin | c := SBECell new. origin := self innerBounds origin. self addMorph: c. c position: ((i - 1) * c width) @ ((j - 1) * c height) + origin. c mouseAction: [self toggleNeighboursOfCellAt: i at: j].! ! !SBEGame methodsFor: 'as yet unclassified' stamp: 'HD 5/24/2011 17:43' prior: 33949458! toggleNeighboursOfCellAt: i at: j (i > 1) ifTrue: [ (cells at: i - 1 at: j ) toggleState]. (i < self cellsPerSide) ifTrue: [ (cells at: i + 1 at: j) toggleState]. (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState]. (j < self cellsPerSide) ifTrue: [ (cells at: i at: j + 1) toggleState].! ! SBEGame new openInWorld! !SBEGame methodsFor: 'as yet unclassified' stamp: 'HD 5/24/2011 17:48' prior: 33950039! newCellAt: i at: j "Create a cell for position (i,j) and add it to my on--screen representation at the appropriate screen position. Answer the new cell" | c origin | c := SBECell new. origin := self innerBounds origin. self addMorph: c. c position: ((i - 1) * c width) @ ((j - 1) * c height) + origin. c mouseAction: [self toggleNeighboursOfCellAt: i at: j]. ^c! ! SBEGame new openInWorld! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 10 November 2006 at 6:07:42 pm'! ActiveHand ! Object subclass: #KeyboadMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:09'! initialize ActiveHand newKeyboardFocus: self.! ! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:10'! handlesKeyboad ^ true.! ! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:11'! keyStroke: anEvent Transcript show: anEvent keyValue.! ! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:12'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus']! ! Object subclass: #KeyboardMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! Smalltalk removeClassNamed: #KeyboardMorph! a! Morph subclass: #NameOfSubclass instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! Smalltalk removeClassNamed: #NameOfSubclass! Morph subclass: #KeyboardMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! KeyboardMorph new.! KeyboardMorph new.! a! World lastKeystroke.! World lastKeystroke.! World lastKeystroke.! Smalltalk removeClassNamed: #KeyboardMorph! 'From SqueakLight of 16 August 2006 [latest update: #394] on 30 August 2008 at 7:49:37 am'! StringMorph subclass: #InfoMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:30'! initialize super initialize. showSeconds _ true. self step! ! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:39'! initializeToStandAlone super initializeToStandAlone. self step! ! !InfoMorph methodsFor: 'step' stamp: 'edc 5/12/2005 16:06'! step | time | super step. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'EDC 2/20/2002 11:30'! stepTime "Answer the desired time between steps in milliseconds." ^ 1000! ! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'EDC 6/26/2002 15:34'! cambio: s info contents:s! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! InfoMorph class instanceVariableNames: ''! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30'! authoringPrototype ^ super authoringPrototype contents: Time now printString! ! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30'! descriptionForPartsBin ^ self partName: 'Clock' categories: #('Useful') documentation: 'A digital clock'! ! !InfoMorph class methodsFor: 'as yet unclassified' stamp: 'edc 12/19/2003 13:24'! doSystemMapFrom: aClass | myMap x allClassesIneed index allClassesDict | allClassesIneed _ Set new. allClassesDict _ self storedIdentytyDict. myMap _ Arbol nuevo. myMap contenido: (SimpleButtonMorph new label: aClass asString). x _ allClassesDict storedIdentytyDict at: aClass value ifAbsent: []. index _ 1. x do: [:each | allClassesIneed add: each. myMap addNode: Arbol nuevo. (myMap at: index) contenido: (SimpleButtonMorph new label: each asString). index _ index + 1]. ^ myMap! ! ----End fileIn of a stream----! 'From SqueakLight of 16 August 2006 [latest update: #394] on 30 August 2008 at 7:49:37 am'! StringMorph subclass: #InfoMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:30' prior: 33952956! initialize super initialize. showSeconds _ true. self step! ! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:39' prior: 33953091! initializeToStandAlone super initializeToStandAlone. self step! ! !InfoMorph methodsFor: 'step' stamp: 'edc 5/12/2005 16:06' prior: 33953219! step | time | super step. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'EDC 2/20/2002 11:30' prior: 33953398! stepTime "Answer the desired time between steps in milliseconds." ^ 1000! ! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'EDC 6/26/2002 15:34' prior: 33953552! cambio: s info contents:s! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! InfoMorph class instanceVariableNames: ''! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30' prior: 33953756! authoringPrototype ^ super authoringPrototype contents: Time now printString! ! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30' prior: 33953908! descriptionForPartsBin ^ self partName: 'Clock' categories: #('Useful') documentation: 'A digital clock'! ! !InfoMorph class methodsFor: 'as yet unclassified' stamp: 'edc 12/19/2003 13:24' prior: 33954104! doSystemMapFrom: aClass | myMap x allClassesIneed index allClassesDict | allClassesIneed _ Set new. allClassesDict _ self storedIdentytyDict. myMap _ Arbol nuevo. myMap contenido: (SimpleButtonMorph new label: aClass asString). x _ allClassesDict storedIdentytyDict at: aClass value ifAbsent: []. index _ 1. x do: [:each | allClassesIneed add: each. myMap addNode: Arbol nuevo. (myMap at: index) contenido: (SimpleButtonMorph new label: each asString). index _ index + 1]. ^ myMap! ! ----End fileIn of a stream----! InfoMorph new.! InfoMorph new.! | a | a := InfoMorph new. a initializeToStandAlone.! Morph subclass: #TickMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:49'! initialize super initialize. self step.! ! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:49'! wantsSteps ^ true.! ! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:49'! stepTime ^ 1000 "msecs"! ! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:50'! step Transcript show: 'J'! ! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 01:52' prior: 33957320! step super step. Transcript show: 'J'! ! TickMorph new.! TickMorph new.! TickMorph new.! self step! self step! self start! TickMorph new.! TickMorph new.! StringMorph subclass: #TickMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! TickMorph new.! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 01:55' prior: 33957235! stepTime ^ 1 "msecs"! ! TickMorph new.! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 01:56' prior: 33957054! initialize super initialize. self startStepping.! ! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 02:00' prior: 33958206! initialize super initialize. self step.! ! TickMorph new.! | a | a := TickMorph new. a startSteppingIn: World! | a | a := TickMorph new. a startSteppingIn: World! | a | a := TickMorph new. a startSteppingIn: World! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 02:01' prior: 33958075! stepTime ^ 10 "msecs"! ! | a | a := TickMorph new. a startSteppingIn: World! | a | a := TickMorph new. a startSteppingIn: World! ----QUIT----{25 May 2011 . 2:03:19 am} Squeak4.1.image priorSource: 392490! ----STARTUP----{25 May 2011 . 2:03:51 am} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! ----QUIT/NOSAVE----{25 May 2011 . 2:04:49 am} Squeak4.1.image priorSource: 404423! ----STARTUP----{4 June 2011 . 2:44:13 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! | i | i := InfoMorph new. i initializeToStandAlone.! | i | i := InfoMorph new. i initializeToStandAlone.! | i | i := InfoMorph new. i initialize.! | i | i := InfoMorph new.! | i | i := InfoMorph new. i show.! | i | i := InfoMorph new. i initialize.! | i | i := InfoMorph new. i initialize. Transcript show: 'Abc'.! | i | i := InfoMorph new. i initialize. Transcript show: 'Abc'.! Transcript show: 'Abc'.! Transcript show: 'Abc'.! | i | i := InfoMorph new. i initialize. Transcript show: 'Abc'.! | i | i := InfoMorph new. i position: 100 @ 200; openInWorld! Transcript show: 'abc'.! | i | i := InfoMorph new. i position: 100 @ 200; openInWorld. Transcript show: 'abc'.! ----QUIT----{4 June 2011 . 3:05:54 pm} Squeak4.1.image priorSource: 404423! ----STARTUP----{5 June 2011 . 10:57:19 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 22:59' prior: 33955265! step | time | super step. Transcript show: 'step'. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:04' prior: 33960373! step | time | super step. Transcript show: 'step'. self destroy. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:04' prior: 33960592! step | time | super step. Transcript show: 'step'. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:45'! handlesKeyboard ^ true.! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:45'! keyStroke: anEvent Transcript show: anEvent keyValue.! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:46'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus']! ! "Open a InfoMorph with timer" | i | i := InfoMorph new. ActiveHand newKeyboardFocus: i. i position: 100 @ 200; openInWorld.! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:48' prior: 33960826! step | time | super step. Transcript show: 'step'. self destroy. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:48' prior: 33961564! step | time | super step. "Transcript show: 'step'." time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! "Open a InfoMorph with timer" | i | i := InfoMorph new. ActiveHand newKeyboardFocus: i. i position: 100 @ 200; openInWorld.! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/5/2011 23:51' prior: 33961112! keyStroke: anEvent Transcript show: 'bla'. Transcript show: anEvent keyValue.! ! "Open a InfoMorph with timer" | i | i := InfoMorph new. ActiveHand newKeyboardFocus: i. i position: 100 @ 200; openInWorld.! HandMorph subclass: #InputMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InputMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:53'! handlesKeyboard ^ true.! ! !InputMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:53'! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! !InputMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:53'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus']! ! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/5/2011 23:54' prior: 33962789! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'InputGot Focus' ] ifFalse: [ Transcript show: 'InputLost Focus']! ! "Open a InfoMorph with timer" | info input | info := InfoMorph new. input := InputMorph new. ActiveHand newKeyboardFocus: input. info position: 100 @ 200; openInWorld.! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/5/2011 23:56' prior: 33962646! keyStroke: anEvent Transcript show: 'bla'. Transcript show: anEvent keyValue. "Event processing here"! ! "Open a InfoMorph with timer" | info input | info := InfoMorph new. input := InputMorph new. ActiveHand newKeyboardFocus: input. info position: 100 @ 200; openInWorld.! "Open a InfoMorph with timer" | info input | info := InfoMorph new. input := InputMorph new. ActiveHand newKeyboardFocus: input. info position: 100 @ 200; openInWorld. input position: 150 @ 200; openInWorld.! ----STARTUP----{7 June 2011 . 1:50:09 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! ActiveHand! ----QUIT----{7 June 2011 . 2:13:05 pm} Squeak4.1.image priorSource: 405615! ----STARTUP----{7 June 2011 . 6:28:09 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! Sensor ! ----QUIT----{7 June 2011 . 6:34:25 pm} Squeak4.1.image priorSource: 409666! ----STARTUP----{8 June 2011 . 1:10:50 am} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! ActiveHand! ActiveHand! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:13'! handlesKeyboard ^ true.! ! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 01:13' prior: 33964692! handlesKeyboard Transcript show: 'ask handlesk'. ^ true.! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:14'! keyStroke: anEvent Transcript show: 'keyStroke'. Transcript show: anEvent keyValue. "Event processing here"! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:14'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus'] ! ! "Open a InfoMorph with timer" | info input | info := InfoMorph new. ActiveHand newKeyboardFocus: info. info position: 100 @ 200; openInWorld.! TextMorph subclass: #InputMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InputMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:24'! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! | input | input := InputMorph new. ActiveHand newKeyboardFocus: input. input position: 100 @ 200; openInWorld.! ----QUIT----{8 June 2011 . 1:28:01 am} Squeak4.1.image priorSource: 409926! ----STARTUP----{8 June 2011 . 2:15:18 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! TextMorph subclass: #PacmanApp instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlA keyPlB keyPlC' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! 100 @ 200! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:26' prior: 33965567! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:27' prior: 33966398! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! 2=3! 2=3! 2=2! 2=2 ifTrue: [Transcript show: 'a']! 2=3 ifTrue: [Transcript show: 'a']! 2=3 ifTrue: [Transcript show: 'a']! | input | input := InputMorph new. ActiveHand newKeyboardFocus: input. input position: 100 @ 200; openInWorld.! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:37'! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA = #goUp:. ].! ! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:38'! stepTime "Answer the desired time between steps in milliseconds." ^ 1000! ! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:39'! step | | super step. Transcript show: keyPlA.! ! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:40'! initialize super initialize. self step! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:40' prior: 33967402! initialize super initialize. self step.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:40' prior: 33967535! initialize super initialize. self step. ActiveHand newKeyboardFocus: self.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:40' prior: 33967669! initialize super initialize. self step. ActiveHand newKeyboardFocus: self. self position: 100 @ 200; openInWorld.! ! | pac | pac := PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:43' prior: 33967293! step | | super step. self delete. Transcript show: keyPlA.! ! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:44' prior: 33966573! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here" Transcript show: ' '.! ! "Open a InfoMorph with timer" | info input | info := InputMorph new. ActiveHand newKeyboardFocus: info. info position: 100 @ 200; openInWorld.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:46' prior: 33968082! step | | super step. "self delete." Transcript show: keyPlA.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:46' prior: 33968582! step | | super step. "self delete." Transcript show: keyPlA.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:47' prior: 33966958! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA = #goUp:. Transcript show: 'w pressed' ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:48' prior: 33968896! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA = #goUp:. Transcript show: 'w pressed ' ] ifFalse: [ Transcript show: 'not w pressed '].! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:49' prior: 33969156! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA := #goUp:. Transcript show: 'w pressed ' ] ifFalse: [ Transcript show: 'not w pressed '].! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:50' prior: 33969484! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA := #goUp:. ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:52' prior: 33969813! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA := #goUp:. ]. (anEvent keyValue = 97) ifTrue: [ keyPlA := #goLeft:. ]. (anEvent keyValue = 115) ifTrue: [ keyPlA := #goDown:. ]. (anEvent keyValue = 100) ifTrue: [ keyPlA := #goRight:. ]. (anEvent keyValue = 105) ifTrue: [ keyPlB := #goUp:. ]. (anEvent keyValue = 106) ifTrue: [ keyPlB := #goLeft:. ]. (anEvent keyValue = 107) ifTrue: [ keyPlB := #goDown:. ]. (anEvent keyValue = 108) ifTrue: [ keyPlB := #goRight:. ]. (anEvent keyValue = 30) ifTrue: [ keyPlC := #goUp:. ]. (anEvent keyValue = 28) ifTrue: [ keyPlC := #goLeft:. ]. (anEvent keyValue = 31) ifTrue: [ keyPlC := #goDown:. ]. (anEvent keyValue = 29) ifTrue: [ keyPlC := #goRight:. ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:53' prior: 33968739! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:53' prior: 33970960! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlC. Transcript show: '\n'.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:54' prior: 33971139! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlC. Transcript cr.! ! PacmanApp new.! ----SNAPSHOT----{8 June 2011 . 2:56:27 pm} Squeak4.1.image priorSource: 411333! Object subclass: #Field instanceVariableNames: 'row column' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #Wall instanceVariableNames: 'color' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Field subclass: #Wall instanceVariableNames: 'color' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Field subclass: #EmptyField instanceVariableNames: 'points' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #Pacman instanceVariableNames: 'onField' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 15:16'! initialize "setting up the grid" witdh := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:16' prior: 33972547! initialize "setting up the grid" witdh := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:18' prior: 33973801! initialize "setting up the grid" width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)].! ! Object subclass: #FieldMap instanceVariableNames: 'height template fields width' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: 'width height template fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: 'width height fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:19' prior: 33975059! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:20' prior: 33976884! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:22' prior: 33978271! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:22' prior: 33979926! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:22' prior: 33981503! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 15:23'! dump ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:23' prior: 33984703! dump 1 to: height do: [:j | 1 to: width do: [:i | (fields at: j) at: i put: EmptyField new. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:24' prior: 33984801! dump 1 to: height do: [:j | 1 to: width do: [:i | (fields at: j) at: i getChar. ]. ].! ! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 15:25'! getChar ^' '.! ! !Field methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:25' prior: 33985159! getChar ^ ' '.! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 15:26'! getChar ^ (points) printString.! ! !Wall methodsFor: 'nil' stamp: 'HD 6/8/2011 15:26'! getChar ^ '+'.! ! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlA keyPlB keyPlC fieldMap' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:27' prior: 33967839! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 100 @ 200; openInWorld.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:27' prior: 33971435! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlC. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:28' prior: 33985004! dump 1 to: height do: [:j | 1 to: width do: [:i | Transcript show: ((fields at: j) at: i getChar). ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:29' prior: 33986224! dump 1 to: height do: [:j | 1 to: width do: [:i | Transcript show: (((fields at: j) at: i) getChar). ]. ].! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:30' prior: 33967157! stepTime "Answer the desired time between steps in milliseconds." ^ 10000! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:31' prior: 33986433! dump 1 to: height do: [:j | 1 to: width do: [:i | Transcript show: (((fields at: j) at: i) getChar). ]. Transcript cr. ].! ! ----SNAPSHOT----{8 June 2011 . 3:31:26 pm} Squeak4.1.image priorSource: 417201! PacmanApp new.! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 15:33'! initialize points := 1.! ! PacmanApp new.! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:36' prior: 33983122! initialize "setting up the grid" | template | width := 35. height := 3. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:38' prior: 33987291! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:38' prior: 33988903! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! PacmanApp new.! PacmanApp new.! ----QUIT----{8 June 2011 . 3:40:07 pm} Squeak4.1.image priorSource: 432535! ----STARTUP----{8 June 2011 . 3:42:58 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:43' prior: 33985694! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 10 @ 10; openInWorld.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:43' prior: 33992408! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld.! ! PacmanApp new.! Object subclass: #Pacman instanceVariableNames: 'onRow onCol' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #Pacman instanceVariableNames: 'onRow onCol color' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! ----QUIT----{8 June 2011 . 3:47:07 pm} Squeak4.1.image priorSource: 437636! ----STARTUP----{8 June 2011 . 6:38:17 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:39'! onRow: row onRow := row.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:39'! onCol: col onCol := col.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:40'! color: c color := c.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:41' prior: 33993579! color: c " R(ed), B(lue), G(reen)" color := c.! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:42' prior: 33985936! step | | super step. "self delete." Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:42' prior: 33970045! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlR := #goUp:. ]. (anEvent keyValue = 97) ifTrue: [ keyPlR := #goLeft:. ]. (anEvent keyValue = 115) ifTrue: [ keyPlR := #goDown:. ]. (anEvent keyValue = 100) ifTrue: [ keyPlR := #goRight:. ]. (anEvent keyValue = 105) ifTrue: [ keyPlB := #goUp:. ]. (anEvent keyValue = 106) ifTrue: [ keyPlB := #goLeft:. ]. (anEvent keyValue = 107) ifTrue: [ keyPlB := #goDown:. ]. (anEvent keyValue = 108) ifTrue: [ keyPlB := #goRight:. ]. (anEvent keyValue = 30) ifTrue: [ keyPlG := #goUp:. ]. (anEvent keyValue = 28) ifTrue: [ keyPlG := #goLeft:. ]. (anEvent keyValue = 31) ifTrue: [ keyPlG := #goDown:. ]. (anEvent keyValue = 29) ifTrue: [ keyPlG := #goRight:. ].! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:45' prior: 33990515! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:45' prior: 33995495! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:45' prior: 33997171! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB = Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'R'. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:46' prior: 33998983! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB = Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'R'. plG = Pacman new. plG onRow: 1. plG onCol: 30. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:46' prior: 34000796! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB = Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG = Pacman new. plG onRow: 1. plG onCol: 30. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:47' prior: 33986830! dump 1 to: height do: [:j | 1 to: width do: [:i | plR Transcript show: (((fields at: j) at: i) getChar). ]. Transcript cr. ].! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:47'! onRow ^ onRow.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:47'! onCol ^ onCol.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:47'! color ^ color.! ! 1=1! 1=1 and: [2= 2]! 1=1 and: [2= 3] ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:51' prior: 34004424! dump 1 to: height do: [:j | 1 to: width do: [:i | (plR onRow = j and: [plR onCol = i]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ Transcript show: (((fields at: j) at: i) getChar). ] ]. Transcript cr. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:52' prior: 34004920! dump 1 to: height do: [:j | 1 to: width do: [:i | (plR onRow = j and: [plR onCol = i]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ (plB onRow = j and: [plB onCol = i]) ifTrue: [ Transcript show: plB color. ] ifFalse: [ (plG onRow = j and: [plG onCol = i]) ifTrue: [ Transcript show: plG color. ] ifFalse: [ Transcript show: (((fields at: j) at: i) getChar). ] ] ] ]. Transcript cr. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:54' prior: 34002610! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 30. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! PacmanApp new.! ----SNAPSHOT----{8 June 2011 . 6:54:57 pm} Squeak4.1.image priorSource: 438676! ----QUIT----{8 June 2011 . 6:55:19 pm} Squeak4.1.image priorSource: 453137! ----STARTUP----{8 June 2011 . 7:01:47 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 19:03'! canBeVisited ^ false.! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 19:04'! canBeVisited ^ true.! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points ^ points.! ! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points ^ 0.! ! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points: pt! ! !Field methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:05' prior: 34008264! points: pt ! ! !Field methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:05' prior: 34008363! points: pt! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points: pt points := pt.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:07' prior: 33994135! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:08' prior: 34008654! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:09'! calcMovement: wantedMove of: player! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:10' prior: 34009167! calcMovement: wantedMove of: player ! ! FieldMap removeSelector: #calcMovement:of:! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:14'! calcMove: move on: field! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:15' prior: 34009434! calcMove: move on: field ! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:15'! fields ^ fields.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:16' prior: 34009548! calcMove: move on: field ! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:17' prior: 34009741! calcMove: move on: field self perform: move with: field! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:18'! calcMoveOn: field row: row col: col ! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:18' prior: 34009971! calcMoveOn: field row: row col: col ((field fields at: row) at: col) ! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:20' prior: 34010098! calcMoveOn: field row: row col: col ((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ]! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:20' prior: 34010258! calcMoveOn: field row: row col: col ((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:23'! goUp: field Transcript show: 'a'. self calcMoveOn: field row: onRow col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:23' prior: 34010815! goUp: field self calcMoveOn: field row: onRow col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:24' prior: 34010987! goUp: field self calcMoveOn: field row: onRow+1 col: onCol.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:24'! goDown: field self calcMoveOn: field row: onRow-1 col: onCol.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:24'! goLeft: field self calcMoveOn: field row: onRow col: onCol-1.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:24'! goRight: field self calcMoveOn: field row: onRow col: onCol-1.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:24' prior: 34011497! goRight: field self calcMoveOn: field row: onRow col: onCol+1.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:26'! movePlR: move plR mov! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:26' prior: 34011775! movePlR: move plR calcMove: move on: self.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:26'! movePlB: move plB calcMove: move on: self.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:26'! movePlG: move plG calcMove: move on: self.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:27' prior: 34008927! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap dump.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:28' prior: 34009857! calcMove: move on: field (move = nil) ifFalse: [self perform: move with: field.] .! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:29'! initialize score := 0.! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:31' prior: 34011255! goDown: field self calcMoveOn: field row: onRow+1 col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:31' prior: 34011136! goUp: field self calcMoveOn: field row: onRow-1 col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:31' prior: 34013043! goUp: field self calcMoveOn: field row: onRow-1 col: onCol.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:32'! width ^ width.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:32'! height ^ height.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:34' prior: 34010530! calcMoveOn: field row: row col: col ( col >= 0 and: [field height >= col and: [row >= 0 and: [field width >= row and: [((field fields at: row) at: col) canBeVisited]]]] ) ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:35' prior: 34013496! calcMoveOn: field row: row col: col ( col >= 1 and: [field height+1 >= col and: [row >= 1 and: [field width+1 >= row and: [((field fields at: row) at: col) canBeVisited]]]] ) ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:37' prior: 34013902! calcMoveOn: field row: row col: col ( col >= 1 and: [field width+1 >= col and: [row >= 1 and: [field height+1 >= row and: [((field fields at: row) at: col) canBeVisited]]]] ) ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:38' prior: 33986662! stepTime "Answer the desired time between steps in milliseconds." ^ 4000! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:39' prior: 34014329! calcMoveOn: field row: row col: col ( col >= 1 and: [field width+1 >= col and: [row >= 1 and: [field height+1 >= row]]] ) ifTrue: [((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ] ]! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:41' prior: 34014924! calcMoveOn: field row: row col: col ( col >= 1 and: [field width >= col and: [row >= 1 and: [field height >= row]]] ) ifTrue: [((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ] ]! ! PacmanApp new.! ----SNAPSHOT----{8 June 2011 . 7:42:52 pm} Squeak4.1.image priorSource: 453218! ----QUIT----{8 June 2011 . 7:48:43 pm} Squeak4.1.image priorSource: 461273! ----STARTUP----{9 June 2011 . 12:19:45 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:29' prior: 34012231! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap dump.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 12:29'! rememberOldPlPos ! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol ' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:30' prior: 34016478! rememberOldPlPos oldPlRrow := plR ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:31' prior: 34016806! rememberOldPlPos oldPlRrow := plR onRow. oldPlRcol := plR onCol. oldPlBrow := plB onRow. oldPlBcol := plB onCol. oldPlGrow := plG onRow. oldPlGcol := plG onCol.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 12:32'! calcCatched ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:36' prior: 34017159! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ ^ true ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:36' prior: 34017264! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ ^ true ]. ^ false.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/9/2011 12:37'! score ^ score.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/9/2011 12:37'! score: s score := s.! ! ----QUIT----{9 June 2011 . 12:37:41 pm} Squeak4.1.image priorSource: 461354! ----STARTUP----{9 June 2011 . 12:56:57 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:59' prior: 34017570! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 13:01' prior: 34018294! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 13:02' prior: 34016127! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 13:03' prior: 34019541! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 13:03'! plR ^plR.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 13:03'! plB ^ plB.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 13:03'! plG ^ plG.! ! ----QUIT----{9 June 2011 . 1:03:48 pm} Squeak4.1.image priorSource: 463521! ----STARTUP----{9 June 2011 . 2:05:21 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:06' prior: 34019948! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:09' prior: 33992665! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. fieldMap draw.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 14:10'! draw! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:14' prior: 34020959! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:15' prior: 34021786! draw "TODO draw all tiles"! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 14:15'! drawUpdates ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:15' prior: 34022577! drawUpdates "Update tiles that changed"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:16' prior: 34022682! drawUpdates "Update tiles that changed" ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:16' prior: 34022814! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 14:18'! drawTileRow: row Col: col "TODO redraw tile specified by row and col"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:18' prior: 34022948! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol. self drawTileRow: plR onRow Col: plR onCol.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:19' prior: 34023255! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol. self drawTileRow: plR onRow Col: plR onCol. self drawTileRow: oldPlBrow Col: oldPlBcol. self drawTileRow: plB onRow Col: plB onCol. self drawTileRow: oldPlGrow Col: oldPlGcol. self drawTileRow: plG onRow Col: plG onCol.! ! ----QUIT----{9 June 2011 . 2:23:06 pm} Squeak4.1.image priorSource: 466187! ----STARTUP----{9 June 2011 . 9:49:29 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:50' prior: 34022490! draw "TODO initialize and draw all tiles"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:51' prior: 34005824! initialize "setting up the grid" | template | width := 14. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:52' prior: 34024263! initialize "setting up the grid" | template | width := 14. "35" height := 4. "17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:52' prior: 34026080! initialize "setting up the grid" | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !Wall methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:53' prior: 33985427! getChar (color = 'R') ifTrue: [^ 'r']. (color = 'B') ifTrue: [^ 'b']. (color = 'G') ifTrue: [^ 'g']. ^ '+'.! ! PacmanApp new.! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:12'! randomRow ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:12' prior: 34030259! randomRow ^ height atRandom.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:13'! randomCol ^ width atRandom.! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:13'! processColoredWall! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:14' prior: 34021883! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. fieldMap processColoredWall. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:16' prior: 34030768! processColoredWall | x y | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. ]! ! !Field methodsFor: 'nil' stamp: 'HD 6/9/2011 22:17'! isWall ^ false.! ! !Wall methodsFor: 'nil' stamp: 'HD 6/9/2011 22:17'! isWall ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:20' prior: 34031520! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:21' prior: 34031868! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ]! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:21'! randomColor | c | c := 3 atRandom.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:22' prior: 34032426! randomColor | c | c := 3 atRandom. (c=1) ifTrue: [ ^ 'R' ]. (c=2) ifTrue: [ ^ 'B' ]. ^ 'G'.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:27' prior: 34032112! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ ]! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/9/2011 22:28'! isOnRow: row Col: col (onRow = row and: [ onCol = col]) ifTrue: [ ^ true. ] ifFalse: [ ^ false. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:31' prior: 34032746! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall := nil. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:31' prior: 34033274! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ]! ! PacmanApp new.! !Wall methodsFor: 'nil' stamp: 'HD 6/9/2011 22:32'! color ^ color.! ! !Wall methodsFor: 'nil' stamp: 'HD 6/9/2011 22:32'! color: c color := c.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:36' prior: 34033773! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ rand := 3. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:37' prior: 34034483! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! ----QUIT----{9 June 2011 . 10:37:18 pm} Squeak4.1.image priorSource: 469358! ----STARTUP----{10 June 2011 . 2:54:40 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:56' prior: 34030879! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:56' prior: 34035928! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:57' prior: 34018662! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! Object subclass: #Field instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:59' prior: 34035074! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:00' prior: 34038481! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. coloredWallRow := nil. coloredWallCol := nil. ] ] ]! ! true.! true.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:04' prior: 34037215! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color = coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:04' prior: 34039865! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:06' prior: 34040840! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:06' prior: 34041817! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:06' prior: 34042934! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:07' prior: 34044114! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:08' prior: 34045292! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:08' prior: 34039134! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 4) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. coloredWallRow := nil. coloredWallCol := nil. ] ] ]! ! PacmanApp new.! !Wall methodsFor: 'nil' stamp: 'HD 6/10/2011 15:10'! canBeVisited (color = nil) ifTrue: [ ^ false. ] ifFalse: [ ^ true. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:12' prior: 34046561! calcCatched | plWallColor | (coloredWall !!= nil) ifTrue: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:13' prior: 34049069! calcCatched | plWallColor | (coloredWall = nil) ifTrue: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:13' prior: 34050768! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:15' prior: 34052465! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! true not ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:15' prior: 34054180! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color !!= coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:15' prior: 34055894! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! PacmanApp new.! PacmanApp new.! PacmanApp new.! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'nil' stamp: 'HD 6/10/2011 15:24'! startNewGame! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:24' prior: 34059365! startNewGame | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:25' prior: 34059470! startNewGame | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34027908! initialize "setting up the grid" plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34061296! startNewGame | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34062892! initialize "setting up the grid" plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34064941! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/10/2011 15:28'! getEmptyField true whileTrue: [ ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:28' prior: 34065371! getEmptyField | row col | true whileTrue: [ row := height atRandom. col := width atRandom. ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:30' prior: 34065506! getEmptyField | row col | true whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ row@col. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:31' prior: 34063227! startNewGame | template f | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:31' prior: 34065980! startNewGame | template f | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:32' prior: 34065184! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. self startNewGame.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:32' prior: 34069468! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. self startNewRound.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:32'! startNewRound | template f | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! FieldMap removeSelector: #startNewGame! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:34' prior: 34065707! getEmptyField | row col | [ true ] whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ row@col. ] ]! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:35' prior: 34048208! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. coloredWallRow := nil. coloredWallCol := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:36' prior: 34069935! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := f. h := f. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:37' prior: 34072730! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := f. h := f. [ f = g ] whileTrue: [ g = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:37' prior: 34074501! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := f. h := f. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ f = g ] whileTrue: [ g = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:38' prior: 34076325! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! ----SNAPSHOT----{10 June 2011 . 3:38:29 pm} Squeak4.1.image priorSource: 481153! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:39' prior: 34078198! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: g x. plB onCol: g y. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:39' prior: 34071723! getEmptyField | row col | [ true ] whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ col@row. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:39' prior: 34080236! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: g x. plB onCol: g y. plG onRow: h x. plG onCol: h y.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:40' prior: 34082438! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! PacmanApp new.! Object subclass: #Pacman instanceVariableNames: 'onRow onCol color score totalScore' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:42' prior: 34036571! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:42' prior: 34086487! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 15:42'! totalScore ^ totalScore.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:43' prior: 34087366! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 15:44'! totalScore: ts totalScore := ts.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:45' prior: 34088344! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:50' prior: 34057602! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue'; cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue'; cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green'; cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green'; cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red'; cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red'; cr. ^ true ]. ^ false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:50' prior: 34089352! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. fieldMap startNewRound. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:51' prior: 34092469! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. fieldMap startNewRound. ]. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap drawUpdates. fieldMap dump.! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:52' prior: 34012760! initialize score := 0. totalScore := 0.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:55' prior: 34093651! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. keyPlR := nil. keyPlB := nil. keyPlG := nil. fieldMap startNewRound. ]. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap drawUpdates. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:55' prior: 34094999! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlR := nil. keyPlB := nil. keyPlG := nil. fieldMap startNewRound. ]. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap drawUpdates. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:56' prior: 34024129! draw "TODO initialize and draw all tiles" nil err.! ! ----STARTUP----{10 June 2011 . 4:05:11 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:05' prior: 34078198! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:05' prior: 34071723! getEmptyField | row col | [ true ] whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ col@row. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:06' prior: 34057602! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:06' prior: 34100042! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:07' prior: 34036571! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! Object subclass: #Pacman instanceVariableNames: 'onRow onCol color score totalScore' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 16:07'! totalScore: ts ^ totalScore := ts.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 16:08'! totalScore ^ totalScore.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:08' prior: 34104551! totalScore: ts totalScore := ts.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:09' prior: 34103749! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:09' prior: 34104888! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap startNewRound. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:09' prior: 34105666! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:10' prior: 34106471! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! ----SNAPSHOT----{10 June 2011 . 4:10:23 pm} Squeak4.1.image priorSource: 543141! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:11' prior: 34012760! initialize score := 0. totalScore := 0.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:12' prior: 34107506! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:12' prior: 34108790! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! PacmanApp new.! ----STARTUP----{10 June 2011 . 4:24:52 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:25' prior: 34107506! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:25' prior: 34111365! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:25' prior: 34012760! initialize score := 0. totalScore := 0.! ! ----SNAPSHOT----{10 June 2011 . 4:26:11 pm} Squeak4.1.image priorSource: 556668! PacmanApp new.! ----STARTUP----{10 June 2011 . 4:30:35 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:31' prior: 34112652! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ "fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil." fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! PacmanApp new.! ----STARTUP----{10 June 2011 . 4:32:52 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:33' prior: 34101792! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:34' prior: 34115853! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:34' prior: 34117800! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:35' prior: 34119750! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ^ false.! ! ----SNAPSHOT----{10 June 2011 . 4:35:37 pm} Squeak4.1.image priorSource: 559563! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:36' prior: 34112652! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ "fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:36' prior: 34023093! drawTileRow: row Col: col "TODO redraw tile specified by row and col"! ! ----SNAPSHOT----{10 June 2011 . 4:37:06 pm} Squeak4.1.image priorSource: 569145! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:37' prior: 34123750! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound. fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! ----SNAPSHOT----{10 June 2011 . 4:38:03 pm} Squeak4.1.image priorSource: 570694! ----STARTUP----{10 June 2011 . 4:40:44 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:40' prior: 34125316! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ "fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! ----STARTUP----{10 June 2011 . 4:42:06 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:43' prior: 34097837! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. "f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]." plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 3. plG onRow: 1. plG onCol: 5.! ! ----SNAPSHOT----{10 June 2011 . 4:43:19 pm} Squeak4.1.image priorSource: 572097! PacmanApp new.! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:44' prior: 34125316! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:46:27 pm} Squeak4.1.image priorSource: 575749! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:48' prior: 34128353! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 3. plG onRow: 1. plG onCol: 5.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:49:59 pm} Squeak4.1.image priorSource: 577184! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:50' prior: 34131788! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:51:36 pm} Squeak4.1.image priorSource: 579199! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:53' prior: 34133803! startNewRound | template f g h rand | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. rand := 10 atRandom. (rand = 1) ifTrue: [ ]. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:54' prior: 34135830! startNewRound | template f g h rand | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. rand := 10 atRandom. (rand = 1) ifTrue: [ ((fields at: j) at: i) points: 5. ]. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! ----SNAPSHOT----{10 June 2011 . 4:54:31 pm} Squeak4.1.image priorSource: 581226! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:55:26 pm} Squeak4.1.image priorSource: 585346! ----QUIT----{10 June 2011 . 4:55:31 pm} Squeak4.1.image priorSource: 585445! ----STARTUP----{10 June 2011 . 5:02:44 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:04' prior: 34072017! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:04' prior: 34023477! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol. self drawTileRow: plR onRow Col: plR onCol. self drawTileRow: oldPlBrow Col: oldPlBcol. self drawTileRow: plB onRow Col: plB onCol. self drawTileRow: oldPlGrow Col: oldPlGcol. self drawTileRow: plG onRow Col: plG onCol. self drawTileRow: coloredWallRow Col: coloredWallCol.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34125053! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ true ]. "TODO redraw tile specified by row and col"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34141412! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ true ]. "TODO redraw tile specified by row and col" ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34141624! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34141845! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" ^ true.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 5:06:24 pm} Squeak4.1.image priorSource: 585527! ----QUIT----{10 June 2011 . 5:07:06 pm} Squeak4.1.image priorSource: 587788! ----STARTUP----{23 June 2011 . 8:41:35 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! ----QUIT/NOSAVE----{23 June 2011 . 8:46:03 pm} Squeak4.1.image priorSource: 587870! ----STARTUP----{24 June 2011 . 10:21 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 10:47' prior: 34024129! draw map := Map new. map initialize.! ! PacmanApp new.! PacmanApp new.! ----QUIT/NOSAVE----{24 June 2011 . 10:51:31 am} Squeak4.1.image priorSource: 587870! ----STARTUP----{24 June 2011 . 10:51:34 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 10:52' prior: 34024129! draw "TODO initialize and draw all tiles" map := Map new. map initialize.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 10:53' prior: 34143834! draw "TODO initialize and draw all tiles" "map := Map new. map initialize."! ! PacmanApp new.! ----STARTUP----{24 June 2011 . 10:58:52 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! PacmanApp new.! PacmanApp new.! ----STARTUP----{24 June 2011 . 11:29:13 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! ----STARTUP----{24 June 2011 . 12:42:40 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 12:42' prior: 34142067! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" ^ true.! ! PacmanApp new.! ----QUIT----{24 June 2011 . 12:43:05 pm} Squeak4.1.image priorSource: 587870! ----STARTUP----{24 June 2011 . 12:43:07 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{24 June 2011 . 12:47:47 pm} Squeak4.1.image priorSource: 590477! ----STARTUP----{24 June 2011 . 8:13:58 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Map new.! PacmanApp new.! ----STARTUP----{24 June 2011 . 8:30:58 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 20:40' prior: 33941601! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extend: 330@240 depth: 1. form fillColor: Color Black. ! ! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 20:40' prior: 34021561! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. fieldMap draw. map := Map new. map initialize.! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 20:43' prior: 34145673! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extent: 300@300 depth: Display depth. form fillColor: Color Black. ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:04' prior: 34150371! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:05' prior: 34154627! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400. ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:15' prior: 34158900! initialize | pics blockType form offsetX offsetY| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: offsetX + ((i-1)*16)@offsetY + ((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! PacmanApp new.! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:17' prior: 34163201! initialize | pics blockType offsetX offsetY| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:19' prior: 34167587! initialize | pics blockType offsetX offsetY| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! Object subclass: #Map instanceVariableNames: 'template fields x y players points offsetX offsetY' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:19' prior: 34171955! initialize | pics blockType| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:19' prior: 33946078! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: (offsetX + ((x-1)*16))@(offsetY + ((y-1)*16)). field imageForm display. (fields at: y) at: x put: field.! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:23' prior: 33911295! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:42' prior: 34150083! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. fieldMap draw. ! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:43' prior: 34024129! draw "TODO initialize and draw all tiles" map := Map new. map initialize.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:44' prior: 34144748! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawField: #(col row). ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:44' prior: 34182080! draw "TODO initialize and draw all tiles" map initialize.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:45' prior: 34069709! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. map := Map new. self startNewRound.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:46' prior: 34182266! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawField: #(2 2). ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:48' prior: 34182941! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '#####'. Transcript show: row. Transcript show: col. map redrawField: #(2 2). ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:49' prior: 34183216! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawField: #(col row). ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:52' prior: 34183564! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: (Integer isInteger row). "map redrawField: #(col row)." ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:52' prior: 34183828! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (Integer isInteger row). "map redrawField: #(col row)." ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:53' prior: 34184135! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (row isInteger). "map redrawField: #(col row)." ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:54' prior: 34184468! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (row isInteger). Transcript show: (col isInteger). "map redrawField: #(col row)." ^ true.! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:56'! redrawFieldX: x y: y "redraw part of the map" | field | field := (fields at: y) at: x. field position: (offsetX + ((x-1)*16))@(offsetY + ((y-1)*16)). field imageForm display. (fields at: y) at: x put: field.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:57' prior: 34184810! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (row isInteger). Transcript show: (col isInteger). map redrawFieldX: col y: row. ^ true.! ! ----STARTUP----{24 June 2011 . 10:00:06 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: 'template fields x y players points offsetX offsetY' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 22:02' prior: 33941601! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 22:04' prior: 34186161! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 22:04' prior: 34190361! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:05' prior: 33911295! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:05'! redrawFieldX: x y: y "redraw part of the map" | field | field := (fields at: y) at: x. field position: (offsetX + ((x-1)*16))@(offsetY + ((y-1)*16)). field imageForm display. (fields at: y) at: x put: field.! ! ----QUIT----{24 June 2011 . 10:06:58 pm} Squeak4.1.image priorSource: 590477! ----STARTUP----{24 June 2011 . 10:07:01 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:08' prior: 34069709! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. map := Map new. self startNewRound.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:08' prior: 34024129! draw "TODO initialize and draw all tiles" map initialize.! ! PacmanApp new.! ----QUIT----{24 June 2011 . 10:09:02 pm} Squeak4.1.image priorSource: 644905! ----STARTUP----{24 June 2011 . 10:09:05 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:09' prior: 34144748! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. ^ true.! ! PacmanApp new.! ----QUIT----{24 June 2011 . 10:10:32 pm} Squeak4.1.image priorSource: 645840! ----STARTUP----{25 June 2011 . 10:57:48 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:09' prior: 34200604! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [ Transcript show: plB color. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ Transcript show: plG color. ] ] ]. ^ true.! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:14' prior: 34198880! renderPlayer: playerId x: x y: y "render player at a given coordinate" | player | player := players at: 1. player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/25/2011 11:16' prior: 34194633! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: 1 x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: 2 x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: 3 x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: 4 x: 35 y: 17. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:16' prior: 34201719! renderPlayer: playerId x: x y: y "render player at a given coordinate" | player | player := players at: playerId. player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:20' prior: 34201143! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:28' prior: 34206550! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. "(((fields at: row) at: col) isWall)" ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:34' prior: 34207168! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [Transcript show: 'refresh wall'.]. "(color = 'R') ifTrue: [^ 'r']. (color = 'B') ifTrue: [^ 'b']. (color = 'G') ifTrue: [^ 'g']. ^ '+'." ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:34' prior: 34207810! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [Transcript show: 'refresh wall'.]. "(color = 'R') ifTrue: [^ 'r']. (color = 'B') ifTrue: [^ 'b']. (color = 'G') ifTrue: [^ 'g']. ^ '+'." ^ true. ! ! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:48' prior: 34208607! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := 'r'. (color = 'r') ifTrue: [^ 'r']. (color = 'b') ifTrue: [^ 'b']. (color = 'g') ifTrue: [^ 'g']. (color = '+') ifTrue: [^ '+']. ]. ^ true. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:51' prior: 34209439! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) color. (color = 'r') Transcript show: 'r'. (color = 'b') Transcript show: 'b'. (color = 'g') Transcript show: 'g'. (color = '+') Transcript show: '+'. ]. ^ true. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:51' prior: 34210266! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) color. (color = 'r') Transcript show: 'red'. (color = 'b') Transcript show: 'blue'. (color = 'g') Transcript show: 'yellow'. (color = '+') Transcript show: '+'. ]. ^ true. ! ! PacmanApp new.! ----QUIT----{25 June 2011 . 1:52:50 pm} Squeak4.1.image priorSource: 646362! ----STARTUP----{25 June 2011 . 1:52:53 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:54' prior: 34211142! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) color. (color = 'r') ifTrue: [Transcript show: 'red'.]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ]. ^ true. ! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:56' prior: 34212302! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. (color = 'r') ifTrue: [Transcript show: 'red'.]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ]. ^ true. ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/25/2011 13:57' prior: 34202032! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! !Map methodsFor: 'nil' stamp: 'mr 6/25/2011 13:58'! colorWallX: x y: y "comment stating purpose of message" | | ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:59'! wallColor: color x: x y: y "comment stating purpose of message" | | ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:00' prior: 34213249! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:00' prior: 34218495! wallColor: color x: x y: y "comment stating purpose of message" (color = 'r') ifTrue: [Transcript show: 'red'.]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:02' prior: 34219406! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/redjpg') asMorph. ]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:03' prior: 34219777! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/redjpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:04' prior: 34220211! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:07' prior: 34220759! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/yellow.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:08' prior: 34221308! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/yellow.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') self redrawFieldX: x y: y. ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:12' prior: 34222142! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/yellow.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:20' prior: 34137832! startNewRound | template f g h rand | width := 35. "original 35" height := 17. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. rand := 10 atRandom. (rand = 1) ifTrue: [ ((fields at: j) at: i) points: 5. ]. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:21' prior: 34005253! dump 1 to: height do: [:j | 1 to: width do: [:i | (plR onRow = j and: [plR onCol = i]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ (plB onRow = j and: [plB onCol = i]) ifTrue: [ Transcript show: plB color. ] ifFalse: [ (plG onRow = j and: [plG onCol = i]) ifTrue: [ Transcript show: plG color. ] ifFalse: [ Transcript show: (((fields at: j) at: i) getChar). ] ] ] ]. Transcript cr. ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:21' prior: 34130388! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. "fieldMap dump."! ! PacmanApp new.! ----QUIT----{25 June 2011 . 2:24:23 pm} Squeak4.1.image priorSource: 657523! ----STARTUP----{25 June 2011 . 2:38:56 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! ----QUIT----{25 June 2011 . 2:39:27 pm} Squeak4.1.image priorSource: 673273! ----STARTUP----{26 June 2011 . 8:04 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:20' prior: 34222987! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/green.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:22' prior: 34218659! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:25' prior: 34229145! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] "red ... index 4" ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] "blue = index 2" ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] "green = index 3" ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! PacmanApp new.! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 20:48'! initialize IconicButton new openInWorld.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:49' prior: 34021561! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:49' prior: 34230873! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu initalize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:50' prior: 34231175! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu initialize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:51' prior: 34231498! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu position: 50 @ 20. gamemenu initialize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:51' prior: 34231822! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu position: 50@20. gamemenu initialize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:52' prior: 34232175! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu initialize. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:52' prior: 34230738! initialize | button | button := IconicButton new. button position: 50@20. button openInWorld. ! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:59' prior: 34232849! initialize | button | button := IconicButton new. button position: 50@20. button openeWorld. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:00' prior: 34233058! initialize | button | button := IconicButton new. button position: 50@20. "button openeWorld." ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:00' prior: 34232526! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openeWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:01' prior: 34233443! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:01' prior: 34233767! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. GameMenu new openeWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:02' prior: 34234092! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. GameMenu new openInWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:03' prior: 34234395! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu position: 50@20. gamemenu openInWorld. fieldMap draw.! ! ----STARTUP----{26 June 2011 . 9:06:12 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:07' prior: 34222987! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/green.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:08' prior: 34218659! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] "blue ... index 2" ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] "green ... index 3" ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:09' prior: 34236070! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] "red ... index 4" ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] "blue ... index 2" ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] "green ... index 3" ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! PacmanApp new.! ----QUIT----{26 June 2011 . 9:10:12 pm} Squeak4.1.image priorSource: 673530! ----STARTUP----{26 June 2011 . 9:10:16 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 21:11'! initialize self position: 50@20.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:12' prior: 34021561! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:35' prior: 34237898! initialize "self position: 50@20." ! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:36' prior: 34238025! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openeWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:37' prior: 34238475! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInWorld. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:48' prior: 34238328! initialize super initialize self position: 50@20. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:49' prior: 34239123! initialize super initialize. self position: 50@20. ! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:17' prior: 34238799! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu ActiveWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:19' prior: 34239432! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInHand. fieldMap draw.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:19' prior: 34239757! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openMorphicWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:20' prior: 34240098! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu displayAt: 50@20. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:25' prior: 34240428! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu show. fieldMap draw.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:27' prior: 34240758! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInWorld. fieldMap draw.! ! ----STARTUP----{26 June 2011 . 10:30:48 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:12'! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2; borderColor: #raised. btn label color: Color darkGray. ^ btn.! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 23:22'! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil).! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 23:22'! startGame "comment stating purpose of message" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:26' prior: 34242080! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil) fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated)))).! ! ----QUIT----{26 June 2011 . 11:26:17 pm} Squeak4.1.image priorSource: 683167! ----STARTUP----{26 June 2011 . 11:26:19 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:27' prior: 34242660! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil) fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated)))). ^ panel! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 23:33'! initialize "comment stating purpose of message" | form | super initialize. form := Form extent: self makeControlPanel depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:34' prior: 34021561! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. GameMenu new. fieldMap draw.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:36' prior: 34244124! initialize "comment stating purpose of message" | form | super initialize. form := Form extent: (self makeControlPanel) depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:38' prior: 34244694! initialize "comment stating purpose of message" | form | super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeControlPanel) depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:39' prior: 34244973! initialize "comment stating purpose of message" | form | super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:41' prior: 34241565! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2; borderColor: #raised. btn label color: Color darkGray. Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:01' prior: 34245291! initialize "comment stating purpose of message" | form | super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:04' prior: 34245665! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray. Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:05' prior: 34246672! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. "labelmorph emphasis: 1." "btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray." Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:07' prior: 34246283! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50.! ! PacmanApp new.! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap gameMenu' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:07' prior: 34244402! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gameMenu := GameMenu new. fieldMap draw.! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:17:03 am} Squeak4.1.image priorSource: 688760! ----STARTUP----{27 June 2011 . 9:29:26 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:32' prior: 34247830! initialize "comment stating purpose of message" | temp | super initialize. Transcript show: 'initialize called'. "form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50." temp := self makeButton: 'start game' action: #startGame state: nil.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:32' prior: 34248926! initialize "comment stating purpose of message" | temp | super initialize. Transcript show: 'initialize called'. "form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50." temp := self makeButton: 'start game' action: #startGame state: nil. temp openInWorld.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:33' prior: 34247249! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray. Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:35' prior: 34242519! startGame "comment stating purpose of message" Transcript show: 'start game called'. ! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:36' prior: 34249370! initialize "comment stating purpose of message" | temp | super initialize. Transcript show: 'initialize called'. "form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50." temp := self makeControlPanel. temp openInWorld.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:41' prior: 34243525! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:51' prior: 34251083! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:52' prior: 34251734! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:53' prior: 34252439! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:02' prior: 34253157! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:03' prior: 34253898! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:07' prior: 34254658! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'blabla'. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:10' prior: 34255420! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 10@10. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:10' prior: 34256225! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 30@10. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:10' prior: 34257138! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 30@10. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:13' prior: 34258051! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:27' prior: 34258822! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@60. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:30' prior: 34259610! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: '2'. temp position: 50@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:30' prior: 34260482! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: '2'. temp position: 70@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:31' prior: 34261354! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: '2'. temp position: 70@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. temp := TextMorph new. temp contents: '3'. temp position: 70@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! Morph subclass: #GameMenu instanceVariableNames: 'form map rounds player' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:35' prior: 34262226! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:36' prior: 34250444! startGame "comment stating purpose of message" Transcript show: 'start game called' + (player text) + (rounds text). ! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:37' prior: 34264302! startGame "comment stating purpose of message" Transcript show: player text. ! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:54' prior: 34263338! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. "red player controls" temp := StringMorph new. temp contents: 'Ges. Punkte: 0'. temp position: 10@60. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden Punkte: 0'. temp position: 10@90. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:55' prior: 34264737! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. "red player controls" temp := StringMorph new. temp contents: 'Ges. Punkte: 0'. temp position: 10@60. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden Punkte: 0'. temp position: 10@70. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! ----STARTUP----{27 June 2011 . 10:58:09 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:01' prior: 34243525! makeControlPanel | panel | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:02' prior: 34267324! makeControlPanel | panel | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:03' prior: 34247830! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:04' prior: 34267646! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:04' prior: 34247249! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray. ^ btn.! ! PacmanApp new.! ----QUIT----{27 June 2011 . 11:45:39 am} Squeak4.1.image priorSource: 694162! ----STARTUP----{27 June 2011 . 11:45:42 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:46' prior: 34268276! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. temp := StringMorph new. temp content: 'Runden'. temp position: 10@10. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:47' prior: 34269455! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden'. temp position: 10@10. panel addMorph: temp. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:48' prior: 34269934! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden'. temp position: 10@10. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:49' prior: 34270431! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@10. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:49' prior: 34270934! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 11:49:56 am} Squeak4.1.image priorSource: 714690! ----STARTUP----{27 June 2011 . 11:49:59 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:51' prior: 34271542! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 10@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:51' prior: 34272557! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 50@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:52' prior: 34273266! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:53' prior: 34274009! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 11:53:48 am} Squeak4.1.image priorSource: 717645! ----STARTUP----{27 June 2011 . 11:53:51 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:31' prior: 34274735! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrRPoints := StringMorph new. player contents: 'Punkte: 0'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:32' prior: 34276023! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@40. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:35' prior: 34276900! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrRPoints. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@90. panel addMorph: plrRPoints. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:36' prior: 34277856! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@90. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:36' prior: 34279036! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! ----QUIT----{27 June 2011 . 12:36:56 pm} Squeak4.1.image priorSource: 721042! ----STARTUP----{27 June 2011 . 12:36:59 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:37' prior: 34280234! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp textColor: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:39' prior: 34281658! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp textColor: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. plrROverall textColor: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:42' prior: 34282867! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. "plrROverall textColor: Color red." panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:43' prior: 34284111! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. plrRPoints color: Color red. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:44' prior: 34285370! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:44:52 pm} Squeak4.1.image priorSource: 726893! ----STARTUP----{27 June 2011 . 12:44:54 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:46' prior: 34286653! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 40@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 40@65. plrGPoints color: Color green. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:46' prior: 34288050! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 80@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 80@65. plrGPoints color: Color green. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:47' prior: 34289531! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:48' prior: 34291012! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:49' prior: 34292495! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:50:27 pm} Squeak4.1.image priorSource: 733285! ----STARTUP----{27 June 2011 . 12:50:29 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:53' prior: 34294307! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 100@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:54' prior: 34296362! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 100@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 100@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:55' prior: 34298291! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:57' prior: 34300338! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:57:53 pm} Squeak4.1.image priorSource: 741597! ----STARTUP----{27 June 2011 . 12:57:56 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:01' prior: 34302385! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 1:01:52 pm} Squeak4.1.image priorSource: 750148! ----STARTUP----{27 June 2011 . 1:01:55 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:04'! setPoints: points player: player "comment stating purpose of message" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:07'! setPoints: points playerChar: playerChar "comment stating purpose of message" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:10' prior: 34307808! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints setContents: (plrRPoints contents) + points.].! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:11' prior: 34304913! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: 10 playerChar: 'r'. ^ panel! ! ----QUIT----{27 June 2011 . 1:11:58 pm} Squeak4.1.image priorSource: 752913! ----STARTUP----{27 June 2011 . 1:12:01 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:12' prior: 34307980! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: (plrRPoints contents) + points.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:13' prior: 34311042! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: ((plrRPoints contents) + points).].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:14' prior: 34308257! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: 0. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: 10 playerChar: 'r'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:14' prior: 34311558! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: 0. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: 10 playerChar: 'r'." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:15' prior: 34314100! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: 10 playerChar: 'r'." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:16' prior: 34311299! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: points.].! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:17' prior: 34319207! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: points.]. (playerChar = 'g') ifTrue: [plrRPoints contents: points.]. (playerChar = 'b') ifTrue: [plrRPoints contents: points.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:17' prior: 34316644! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: 10 playerChar: 'r'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:18' prior: 34319814! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:20' prior: 34322358! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:20' prior: 34324921! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:22' prior: 34319457! setPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.]. (playerChar = 'r') ifTrue: [plrRPoints contents: points.]. (playerChar = 'g') ifTrue: [plrRPoints contents: points.]. (playerChar = 'b') ifTrue: [plrRPoints contents: points.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:22' prior: 34330015! setPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'g') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'b') ifTrue: [plrRPoints contents: temp.].! ! PacmanApp new.! ----QUIT----{27 June 2011 . 1:23:07 pm} Squeak4.1.image priorSource: 756279! ----STARTUP----{27 June 2011 . 1:23:10 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'nil' stamp: 'mr 6/27/2011 13:23'! setOverallPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'g') ifTrue: [plrGOverall contents: temp.]. (playerChar = 'b') ifTrue: [plrRPoints contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:24' prior: 34331136! setOverallPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrROverall contents: temp.]. (playerChar = 'g') ifTrue: [plrGOverall contents: temp.]. (playerChar = 'b') ifTrue: [plrBOverall contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:24' prior: 34330450! setPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'g') ifTrue: [plrGPoints contents: temp.]. (playerChar = 'b') ifTrue: [plrBPoints contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:26' prior: 34327469! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 1:27:37 pm} Squeak4.1.image priorSource: 776405! ----STARTUP----{27 June 2011 . 1:34:34 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! Morph subclass: #Map instanceVariableNames: 'template fields x y players points offsetX offsetY' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:09' prior: 34214192! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:09' prior: 34335563! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:10' prior: 34339802! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. self addMorph: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:10' prior: 34344029! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. self addMorph: temp. temp openInWorld. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:22' prior: 34348298! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. self addMorph: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! ----QUIT/NOSAVE----{27 June 2011 . 3:27:22 pm} Squeak4.1.image priorSource: 780619! ----STARTUP----{27 June 2011 . 3:27:25 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:40' prior: 34332534! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 200. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:40' prior: 34357090! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:41' prior: 34359697! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:44'! startPacmanApp: app "" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:45' prior: 34364878! startPacmanApp: app "" app step. ActiveHand newKeyboardFocus: app. app position: 20 @ 20; openInWorld.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:48' prior: 34364996! startPacmanApp: app "" app step. ActiveHand newKeyboardFocus: app. app position: 300 @ 20. form addMorph: app.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:48' prior: 34248380! initialize super initialize. fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:49' prior: 34365406! initialize super initialize. fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:50' prior: 34365656! initialize super initialize. fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:52' prior: 34331604! setOverallPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrROverall contents: temp.]. (playerChar = 'g') ifTrue: [plrGOverall contents: temp.]. (playerChar = 'b') ifTrue: [plrBOverall contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:52' prior: 34362304! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'." ^ panel! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:19' prior: 34214192! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = '#' ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:20' prior: 34369179! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:20' prior: 34373396! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $ ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:20' prior: 34377612! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = ' ' ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:21' prior: 34381828! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! ----QUIT----{27 June 2011 . 5:21:52 pm} Squeak4.1.image priorSource: 780619! ----STARTUP----{27 June 2011 . 5:21:56 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:22' prior: 34386046! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:27' prior: 34390504! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) = $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) = $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) = $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) = $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:31' prior: 34394722! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) = $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) = $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) = $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) = $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 17:33' prior: 34235227! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/green.jpg') asMorph. form position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! PacmanApp new.! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 17:41' prior: 34206224! renderPlayer: playerId x: x y: y "render player at a given coordinate" | player | player := players at: playerId. player position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). player imageForm display.! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:44' prior: 34398953! initialize | pics blockType | super initialize. offsetX := 10. offsetY := 120. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) = $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) = $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) = $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) = $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! PacmanApp new.! ----QUIT----{27 June 2011 . 5:45:31 pm} Squeak4.1.image priorSource: 835747! ----STARTUP----{28 June 2011 . 11:15:05 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 11:23' prior: 34226475! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. "fieldMap dump."! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 11:25' prior: 34408848! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB totalScore. gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG totalScore. gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. "fieldMap dump."! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:22' prior: 34014759! stepTime "Answer the desired time between steps in milliseconds." ^ 2000! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:23' prior: 34412042! stepTime "Answer the desired time between steps in milliseconds." ^ 500! ! PacmanApp new.! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:27' prior: 34412228! stepTime "Answer the desired time between steps in milliseconds." ^ 100! ! PacmanApp new.! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:46' prior: 34365883! initialize super initialize. "fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw."! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:47' prior: 34268007! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. "fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw."! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:48' prior: 34412858! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. fieldMap := FieldMap new. "gameMenu := GameMenu new." "gameMenu startPacmanApp: self." fieldMap draw.! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:49' prior: 34413441! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." "gameMenu startPacmanApp: self." fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:50' prior: 34414036! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:50' prior: 34242519! startGame "comment stating purpose of message" fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." self startPacmanApp: pacmanApp. fieldMap draw.! ! PacmanApp new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:52'! initializeMap: map menu: menu super initialize. fieldMap := map. gameMenu := menu ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:53' prior: 34412632! initialize super initialize. "fieldMap := map. gameMenu := menu" ! ! !PacmanApp methodsFor: 'nil' stamp: 'mr 6/28/2011 12:53'! setMap: map menu: menu "comment stating purpose of message" ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:54' prior: 34415153! initialize super initialize. ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:54' prior: 34415284! setMap: map menu: menu "comment stating purpose of message" fieldMap := map. gameMenu := menu.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:54' prior: 34414681! startGame "comment stating purpose of message" fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:48'! startRound "comment stating purpose of message" fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:51' prior: 34415756! startGame "comment stating purpose of message" numRounds := rounds content. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:52' prior: 34366593! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := self makeButton: 'new round' action: #startRound state: nil. temp position: 250@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:54' prior: 34416630! startGame "comment stating purpose of message" numRounds := (rounds content) asInteger. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:54' prior: 34419695! startGame "comment stating purpose of message" numRounds := (rounds content) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:55' prior: 34420057! startGame "comment stating purpose of message" numRounds := (rounds contents) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:57' prior: 34420492! startGame "comment stating purpose of message" numRounds := (rounds text) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:57' prior: 34420928! startGame "comment stating purpose of message" numRounds := (rounds text) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:57' prior: 34421360! startGame "comment stating purpose of message" numRounds := (rounds asText) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:58' prior: 34421792! startGame "comment stating purpose of message" numRounds := (rounds asText). "asInteger." Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:59' prior: 34422226! startGame "comment stating purpose of message" numRounds := (rounds contents). "asInteger." Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:01' prior: 34422663! startGame "comment stating purpose of message" numRounds := (rounds contents) asNumber. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:04' prior: 34423102! startGame "comment stating purpose of message" numRounds := (rounds contents) asNumber. rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/28/2011 14:05'! finishGame Transcript show: 'Game over'.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:05' prior: 34416070! startRound "comment stating purpose of message" rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:10' prior: 34424070! startRound "comment stating purpose of message" | temp | temp := (plrRPoints contents) asNumber. rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:12'! getPointsPlayerChar: playerChar "comment stating purpose of message" | | (playerChar = 'r') ifTrue: [^ ((plrRPoints contents) asNumber).]. (playerChar = 'g') ifTrue: [^ ((plrGPoints contents) asNumber).]. (playerChar = 'b') ifTrue: [^ ((plrBPoints contents) asNumber).].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:13'! getOverallPointsPlayerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [^ ((plrROverall contents) asNumber).]. (playerChar = 'g') ifTrue: [^ ((plrGOverall contents) asNumber).]. (playerChar = 'b') ifTrue: [^ ((plrBOverall contents) asNumber).].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:15' prior: 34424454! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:15' prior: 34425618! startRound "comment stating purpose of message" "self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'." rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:18' prior: 34426121! startRound "comment stating purpose of message" "self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'." numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:18' prior: 34423537! startGame "comment stating purpose of message" numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:22' prior: 34426658! startRound "comment stating purpose of message" "self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'." numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:24' prior: 34410346! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:25' prior: 34427628! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:27' prior: 34429878! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame.]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:27' prior: 34430425! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. self setOverallPoints: ( (self getPointsPlayerChar: 'g') + (self getOverallPointsPlayerChar: 'g')) playerChar: 'g'. self setOverallPoints: ( (self getPointsPlayerChar: 'b') + (self getOverallPointsPlayerChar: 'b')) playerChar: 'b'. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame.]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:30' prior: 34427172! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:31' prior: 34431719! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. self inform: 'heyho'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:32' prior: 34432417! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:36' prior: 34423936! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) && ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Press "start game" to play again!!'.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:36' prior: 34433820! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) && ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Winner: ' + winner.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:38' prior: 34434634! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) & ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Winner: ' + winner.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:39' prior: 34435447! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) & ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Winner: ' , winner.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:42' prior: 34436257! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) & ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := winner , 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := winner , 'blue']. self inform: 'Game Finished. Winner: ' , winner.! ! ----QUIT----{28 June 2011 . 2:45:27 pm} Squeak4.1.image priorSource: 854066! ----STARTUP----{28 June 2011 . 2:55:45 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:59' prior: 34428178! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." gameMenu startRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:02' prior: 34438121! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." gameMenu startRound. "fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! GameMenu new.! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:09' prior: 34439864! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." fieldMap draw. gameMenu startRound. "fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:11' prior: 34441641! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map gameMenu' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'nil' stamp: 'mr 6/28/2011 15:18'! setGameMenu: menu "comment stating purpose of message" gameMenu := menu.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:18' prior: 34414973! initializeMap: map menu: menu super initialize. fieldMap := map. map setGameMenu: menu. gameMenu := menu ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:21' prior: 34121701! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ^ false.! ! GameMenu new.! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:24' prior: 34445553! initializeMap: map menu: menu super initialize. fieldMap := map. fieldMap setGameMenu: menu. gameMenu := menu ! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:28' prior: 34433139! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:31' prior: 34445756! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plR score) playerChar: 'r'. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plR score) playerChar: 'r'. ^ true ]. ^ false.! ! ----QUIT----{28 June 2011 . 3:32:58 pm} Squeak4.1.image priorSource: 883357! ----STARTUP----{28 June 2011 . 6:05:28 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds numPlayer' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:09' prior: 34448239! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid player size'. ^ ''. ]. numRounds := (rounds contents) asNumber. (numRounds < 1) ifTrue:[ self inform: 'invalid number of rounds'. ^ ''. ]. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap gameMenu botPlB botPlG' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:15' prior: 34415439! initialize super initialize. botPlB := false. botPlG := false. ! ! !PacmanApp methodsFor: 'nil' stamp: 'mr 6/28/2011 18:16'! setBotPlB: value "" botPlB := value.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:16'! setBotPlG: value "" botPlG := value.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:18' prior: 34452128! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid player size'. ^ ''. ]. numRounds := (rounds contents) asNumber. (numRounds < 1) ifTrue:[ self inform: 'invalid number of rounds'. ^ ''. ]. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. (numPlayer < 3) ifTrue: [pacmanApp setBotPlG: true]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlB: true]. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:21' prior: 34443388! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! ----STARTUP----{28 June 2011 . 6:22:14 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! GameMenu new.! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap gameMenu botPlB botPlG' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:43'! setBotPlB: value "" botPlB := false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:43'! setBotPlG: value "" botPlG := value.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:43' prior: 34456849! setBotPlB: value "" botPlB := value.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:44' prior: 34415439! initialize super initialize. botPlG := false. botPlB := false. ! ! GameMenu new.! GameMenu new.! ----QUIT----{28 June 2011 . 6:44:52 pm} Squeak4.1.image priorSource: 897110! ----STARTUP----{28 June 2011 . 6:44:55 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:45' prior: 34443388! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifFalse: [fieldMap movePlB: keyPlB.]. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:46' prior: 34457665! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:49'! randomDirection | c | c := 4 atRandom. (c=1) ifTrue: [ ^ #goLeft ]. (c=2) ifTrue: [ ^ #goUp ]. (c=3) ifTrue: [^ #goRight]. ^ #goDown.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:50' prior: 34459446! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifTrue: [fieldMap movePlB: (self randomDirection).] ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifTrue: [fieldMap movePlG: (self randomDirection).] ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! ----QUIT----{28 June 2011 . 6:50:35 pm} Squeak4.1.image priorSource: 902901! ----STARTUP----{28 June 2011 . 6:50:38 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! GameMenu new.! ----QUIT----{28 June 2011 . 6:51:13 pm} Squeak4.1.image priorSource: 908830! ----STARTUP----{28 June 2011 . 6:51:16 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:51' prior: 34448239! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds numPlayer' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:53' prior: 34463850! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ true. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:54' prior: 34464819! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:58' prior: 34465731! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:58' prior: 34416980! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := self makeButton: 'new round' action: #startRound state: nil. temp position: 250@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'." ^ panel! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 19:00' prior: 34466596! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 19:05' prior: 34461218! randomDirection | c | c := 4 atRandom. (c=1) ifTrue: [ ^ #goLeft:. ]. (c=2) ifTrue: [ ^ #goUp:. ]. (c=3) ifTrue: [^ #goRight:.]. ^ #goDown:.! ! GameMenu new.! GameMenu new.! GameMenu new.! ----QUIT----{28 June 2011 . 7:07:42 pm} Squeak4.1.image priorSource: 909087! \ No newline at end of file | 'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 17 April 2010 at 5:22:05 pm'! ----STARTUP----{17 April 2010 . 5:21:54 pm} as C:\Squeak\4.0\4.1-final\Squeak4.1.image! Smalltalk appendChangesTo: 'SqueakV41.sources'.! ----QUIT----{17 April 2010 . 5:22:11 pm} Squeak4.1.image priorSource: 89! ----STARTUP----{18 April 2010 . 5:57:27 pm} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! !BlockContextTest methodsFor: 'running' stamp: 'md 9/6/2005 19:56' prior: 50431957! setUp super setUp. aBlockContext := [100@100 corner: 200@200]. contextOfaBlockContext := thisContext.! ! !BehaviorTest methodsFor: 'tests' stamp: 'md 2/18/2006 16:42' prior: 17365994! testBinding self assert: Object binding value = Object. self assert: Object binding key = #Object. self assert: Object class binding value = Object class. "returns nil for Metaclasses... like Encoder>>#associationFor:" self assert: Object class binding key = nil.! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53956757! testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #EmbeddedSourceQCompress ). self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer sourceCode: code. self assert: (trailer kind == #EmbeddedSourceZip ). newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:13' prior: 53957691! testEmbeddingTempNames | trailer newTrailer code | trailer := CompiledMethodTrailer new. code := 'foo'. trailer tempNames: code. newTrailer := trailer testEncoding. self assert: (trailer kind == #TempsNamesQCompress ). self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). code := 'testEmbeddingSourceCode | trailer newTrailer code | trailer := CompiledMethodTrailer new. trailer sourceCode: code. newTrailer := trailer testEncoding. self assert: (newTrailer sourceCode = code).'. trailer tempNames: code. self assert: (trailer kind == #TempsNamesZip ). newTrailer := trailer testEncoding. self assert: (newTrailer tempNames = code). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:17' prior: 53958613! testEncodingNoTrailer | trailer | trailer := CompiledMethodTrailer new. "by default it should be a no-trailer" self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #NoTrailer ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:14' prior: 53959109! testEncodingSourcePointer | trailer | trailer := CompiledMethodTrailer new. CompiledMethod allInstancesDo: [:method | | ptr | trailer method: method. self assert: ( (ptr := method sourcePointer) == trailer sourcePointer). "the last bytecode index must be at 0" ptr ~= 0 ifTrue: [ self assert: (method endPC = trailer endPC) ]. ].! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53959564! testEncodingVarLengthSourcePointer | trailer newTrailer | trailer := CompiledMethodTrailer new. trailer sourcePointer: 1. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 1). trailer sourcePointer: 16r100000000000000. newTrailer := trailer testEncoding. self assert: (newTrailer sourcePointer = 16r100000000000000). "the last bytecode index must be at 0" self assert: (newTrailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:15' prior: 53960108! testSourceByIdentifierEncoding | trailer id | trailer := CompiledMethodTrailer new. id := UUID new asString. trailer sourceIdentifier: id. self assert: (trailer kind == #SourceByStringIdentifier ). trailer := trailer testEncoding. self assert: (trailer kind == #SourceByStringIdentifier ). self assert: (trailer sourceIdentifier = id). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CompledMethodTrailerTest methodsFor: 'testing' stamp: 'Igor.Stasenko 12/13/2009 21:49' prior: 53960643! testSourceBySelectorEncoding | trailer | trailer := CompiledMethodTrailer new. trailer setSourceBySelector. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). trailer := trailer testEncoding. self assert: (trailer kind == #SourceBySelector ). self assert: (trailer size = 1). "the last bytecode index must be at 0" self assert: (trailer endPC = 0). ! ! !CategorizerTest methodsFor: 'running' stamp: 'mtf 9/10/2007 10:10' prior: 18074036! setUp categorizer := Categorizer defaultList: #(a b c d e). categorizer classifyAll: #(a b c) under: 'abc'. categorizer addCategory: 'unreal'.! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074267! testClassifyNewElementNewCategory categorizer classify: #f under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') (''nice'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:18' prior: 18074541! testClassifyNewElementOldCategory categorizer classify: #f under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'' f) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:17' prior: 18074806! testClassifyOldElementNewCategory categorizer classify: #e under: #nice. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'') (''nice'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:54' prior: 18075078! testClassifyOldElementOldCategory categorizer classify: #e under: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d) (''abc'' a b c) (''unreal'' e) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:22' prior: 18075341! testDefaultCategoryIsTransient "Test that category 'as yet unclassified' disapears when all it's elements are removed'" categorizer classifyAll: #(d e) under: #abc. self assert: categorizer printString = '(''abc'' a b c d e) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 15:15' prior: 18075669! testNullCategory "Test that category 'as yet unclassified' disapears when all it's elements are removed'" | aCategorizer | aCategorizer := Categorizer defaultList: #(). self assert: aCategorizer printString = '(''as yet unclassified'') '. self assert: aCategorizer categories = #('no messages'). aCategorizer classify: #a under: #b. self assert: aCategorizer printString = '(''b'' a) '. self assert: aCategorizer categories = #(b).! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18076194! testRemoveEmptyCategory categorizer removeCategory: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:55' prior: 18076430! testRemoveExistingElement categorizer removeElement: #a. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076673! testRemoveNonEmptyCategory self should: [categorizer removeCategory: #abc] raise: Error. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:59' prior: 18076950! testRemoveNonExistingCategory categorizer removeCategory: #nice. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 12:57' prior: 18077203! testRemoveNonExistingElement categorizer removeElement: #f. self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/11/2007 14:49' prior: 18077451! testRemoveThenRename categorizer removeCategory: #unreal. categorizer renameCategory: #abc toBe: #unreal. self assert: categorizer printString = '(''as yet unclassified'' d e) (''unreal'' a b c) '! ! !CategorizerTest methodsFor: 'testing' stamp: 'mtf 9/10/2007 10:14' prior: 18077736! testUnchanged self assert: categorizer printString = '(''as yet unclassified'' d e) (''abc'' a b c) (''unreal'') '! ! "KernelTests"! !SMLoaderPlus commentStamp: 'btr 12/1/2006 15:16' prior: 0! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). It uses ToolBuilder to construct its window. You can open one with: SMLoaderPlus open Instance Variables categoriesToFilterIds: <OrderedCollection> The set of categories to filter the packages list. filters: <OrderedCollection> The set of filters to apply to the packages list. map: <SMSqueakMap> The model SqueakMap. packagesList: <OrderedCollection> The list of packages from the map. selectedCategory: <SMCategory> The current category. selectedItem: <SMPackage> The selected package or release. window: <PluggableSystemWindow> The window, held only so we can reOpen.! !SMLoaderCategoricalPlus commentStamp: 'btr 12/4/2006 15:47' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategoricalPlus open! !SMLoader commentStamp: 'btr 11/30/2006 18:00' prior: 27913009! A simple package loader that is currently the standard UI for SqueakMap (the model is an SMSqueakMap instance). You can open one with: SMLoader open! !SMLoaderCategorical commentStamp: 'btr 12/1/2006 15:16' prior: 0! A variant package loader that uses a more-or-less standard Smalltalk-80 browser perspective of selecting categories in one pane and then selecting items within in the next pane. You can open one with: SMLoaderCategorical open! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifPresent: [:tb | (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategoricalPlus class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 17:34'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:50'! buildFancyWith: aBuilder "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)); yourself); add: ((self buildNotInstalledPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ (horizDivide / 2)); yourself); add: ((self buildInstalledPackagesListWith: builder) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide); yourself); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1); yourself); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. self setUpdatablePanesFrom: #(#installedPackageList #notInstalledPackageList ). currentPackageList := #notInstalled. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:56'! buildInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #installedPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 17:52'! buildNotInstalledPackagesListWith: aBuilder ^ aBuilder pluggableTreeSpec new model: self; roots: #notInstalledPackageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; yourself! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:55'! buildWith: aBuilder | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight); yourself); add: ((self buildCategoriesListWith: builder) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide); yourself); add: ((self buildSearchPaneWith: builder) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight))); add: ((self buildPackagesListWith: builder) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide)); add: ((self buildPackagePaneWith: builder) frame: (0 @ horizDivide corner: 1 @ 1)); yourself)). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList ^currentPackageList! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:55'! defaultLabel ^ 'Categorical ' , super defaultLabel! ! !SMLoaderCategoricalPlus methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:52'! installedPackageList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! installedPackagesListIndex ^ self currentPackageList = #installed ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 17:34'! isOn ^false! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:53'! notInstalledPackageList ^self packageList reject: [:e | e isInstalled]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:02'! notInstalledPackagesListIndex ^ self currentPackageList = #notInstalled ifTrue: [self packagesListIndex] ifFalse: [0]! ! !SMLoaderCategoricalPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 18:03'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategoricalPlus methodsFor: 'private' stamp: 'btr 12/1/2006 17:53'! noteChanged self changed: #installedPackageList. self changed: #notInstalledPackageList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategoricalPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 17:34'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! !SMLoaderPlus class methodsFor: 'parts bin' stamp: 'btr 11/22/2006 15:02'! descriptionForPartsBin ^self partName: 'Package Loader' categories: #(Tools) documentation: 'SqueakMap UI' ! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47'! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifPresent: [:tb | self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white "not set" ifTrue: [ Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor) ]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! initializedInstance ^ (ToolBuilder open: self new) extent: 400@400! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! new "Create a SqueakMap loader on the default map." ^self newOn: SMSqueakMap default! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/22/2006 15:02'! newOn: aMap "Create a SqueakMap loader on given map." ^super new on: aMap; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:16'! newStandAlone ^ ToolBuilder open: self new! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:13'! open "Create and open a SqueakMap Loader." "SMLoaderPlus open" ^ (Smalltalk at: #ToolBuilder) open: self new! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoaderPlus class methodsFor: 'instance creation' stamp: 'btr 11/23/2006 11:21'! openOn: aSqueakMap "Create and open a SqueakMap Loader on a given map." "self openOn: SqueakMap default" ^ (Smalltalk at: #ToolBuilder) open: (self newOn: aSqueakMap)! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:18'! prototypicalToolWindow ^ ToolBuilder open: self new; applyModelExtent; yourself! ! !SMLoaderPlus class methodsFor: 'new-morph participation' stamp: 'btr 11/22/2006 15:02'! registerInFlapsRegistry "Register the receiver in the system's flaps registry." self environment at: #Flaps ifPresent: [:cl | (cl respondsTo: #registerQuad:forFlapNamed:) ifTrue: [cl registerQuad: #(#SMLoader #prototypicalToolWindow 'Package Loader' 'The SqueakMap Package Loader' ) forFlapNamed: 'Tools']]! ! !SMLoaderPlus class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:50'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoaderPlus class methodsFor: 'window color' stamp: 'btr 11/22/2006 15:02'! windowColorSpecification "Answer a WindowColorSpec object that declares my preference." ^WindowColorSpec classSymbol: self name wording: 'Package Loader' brightColor: Color yellow muchLighter duller pastelColor: Color yellow veryMuchLighter duller helpMessage: 'The SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! addSelectedCategoryAsFilter "Add a new filter that filters on the currently selected category. Make it enabled as default." categoriesToFilterIds add: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 16:11'! askToLoadUpdates "Check how old the map is and ask to update it if it is older than 10 days or if there is no map on disk." | available | available := map isCheckpointAvailable. (available not or: [ (Date today subtractDate: (Date fromSeconds: (map directory directoryEntryFor: map lastCheckpointFilename) modificationTime)) > 3]) ifTrue: [ (self confirm: (available ifTrue: ['The map on disk is more than 10 days old, update it from the Internet?'] ifFalse: ['There is no map on disk, fetch it from the Internet?'])) ifTrue: [self loadUpdates]]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:43'! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. dir := item isPackage ifTrue: [map cache directoryForPackage: item] ifFalse: [map cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. "withLabel: item name, ' cache directory'." win openInWorld! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildButtonBarWith: aBuilder ^ aBuilder pluggablePanelSpec new model: self; layout: #horizontal; children: (self commandSpecs select: [ :spec | spec fourth includes: #all] thenCollect: [ :spec | aBuilder pluggableActionButtonSpec new model: self; label: spec first; action: spec second; help: spec third; enabled: ((spec fourth includes: #item) ifTrue: [#hasSelectedItem]); yourself]); name: #buttonBar; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:56'! buildCategoriesListWith: aBuilder "Create the hierarchical list holding the category tree." ^ aBuilder pluggableTreeSpec new model: self; roots: #categoryList; getSelectedPath: #selectedCategoryPath; getChildren: #categoryChildren:; hasChildren: #categoryHasChildren:; setSelected: #selectedCategory:; menu: #categoriesMenu:; label: #categoryLabel:; autoDeselect: true; wantsDrop: true; name: #categoriesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagePaneWith: aBuilder "Create the text area to the right in the loader." ^ aBuilder pluggableTextSpec new model: self; getText: #itemDescription; name: #packagePane; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildPackagesListWith: aBuilder "Create the hierarchical list holding the packages and releases." ^ aBuilder pluggableTreeSpec new model: self; roots: #packageList; getSelectedPath: #selectedItemPath; setSelected: #selectedItem:; menu: #packagesMenu:; label: #itemLabel:; getChildren: #itemChildren:; hasChildren: #itemHasChildren:; autoDeselect: true; wantsDrop: true; name: #packagesList; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:57'! buildSearchPaneWith: aBuilder ^ aBuilder pluggableInputFieldSpec new model: self; selection: #searchSelection; getText: #searchText; setText: #findPackage:notifying:; name: #search; yourself! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 06:54'! buildWith: aBuilder "Create the package loader window." | buttonBarHeight vertDivide horizDivide | buttonBarHeight := 0.07. vertDivide := 0.6. horizDivide := 0.3. builder := aBuilder. window := builder build: (builder pluggableWindowSpec new model: self; label: #label; children: (OrderedCollection new add: ((self buildButtonBarWith: builder) frame: (0 @ 0 corner: 1 @ buttonBarHeight)); add: ((self buildSearchPaneWith: builder) frame: (0 @ buttonBarHeight corner: horizDivide @ (buttonBarHeight * 2))); add: ((self buildPackagesListWith: builder) frame: (0 @ (buttonBarHeight * 2) corner: horizDivide @ vertDivide)); add: ((self buildCategoriesListWith: builder) frame: (0 @ vertDivide corner: horizDivide @ 1)); add: ((self buildPackagePaneWith: builder) frame: (horizDivide @ buttonBarHeight corner: 1 @ 1)); yourself); yourself). window on: #mouseEnter send: #paneTransition: to: window. window on: #mouseLeave send: #paneTransition: to: window. window extent: self initialExtent. ^ window! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! cachePackageReleaseAndOfferToCopy "Cache package release, then offer to copy it somewhere. Answer the chosen file's location after copy, or the cache location if no directory was chosen." | release installer newDir newName newFile oldFile oldName | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. installer := SMInstaller forPackageRelease: release. [UIManager default informUser: 'Caching ' , release asString during: [installer cache]] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs. ^nil ]. installer isCached ifFalse: [self inform: 'Download failed, see transcript for details'. ^nil]. oldName := installer fullFileName. newDir := FileList2 modalFolderSelector: installer directory. newDir ifNil: [ ^oldName ]. newDir = installer directory ifTrue: [ ^oldName ]. newName := newDir fullNameFor: installer fileName. newFile := FileStream newFileNamed: newName. newFile ifNil: [ ^oldName ]. newFile binary. oldFile := FileStream readOnlyFileNamed: oldName. oldFile ifNil: [ ^nil ]. oldFile binary. [[ newDir copyFile: oldFile toFile: newFile ] ensure: [ oldFile close. newFile close ]] on: Error do: [ :ex | ^oldName ]. ^newName! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categoriesMenu: aMenu "Answer the categories-list menu." self selectedCategory ifNotNil: [aMenu addList: self categorySpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! categoryChildren: aCategory ^ aCategory subCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! categoryHasChildren: aCategory ^ aCategory hasSubCategories! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:46'! categoryLabel: aCategory ^ aCategory name! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01'! categoryList "Create the category list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (map categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/22/2006 15:02'! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:01'! commandSpecFor: selector ^ self commandSpecs detect: [:spec | spec second = selector]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:00'! commandSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.' (item all)) ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.' (item all)) ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.' (item all)) ('Copy from cache' cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' (item)) ('Force download into cache' downloadPackageRelease 'Force a download of the selected release into the cache.' (item)) ('Update' loadUpdates 'Update the package index from the servers.' (all)) ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (conf8irming each).' (all)) ('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm '' (item)) ('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm '' (item)) ('Copy list' listInPasteBuffer 'Puts the list as text into the clipboard.' (all)) ('Save filters' saveFiltersAsDefault 'Saves the current filters as default.' (all)) ('Help' help 'What is this?' (all)))! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/22/2006 15:02'! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! defaultLabel ^ 'SqueakMap Package Loader'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:38'! downloadPackageRelease "Force a download of the selected package release into the cache." | release | release := self selectedPackageOrRelease. release isPackageRelease ifFalse: [ self error: 'Should be a package release!!']. [UIManager default informUser: 'Downloading ' , release asString during: [ (SMInstaller forPackageRelease: release) download] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil: [ex asString]. self informException: ex msg: ('Error occurred during download:\', msg, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterAdd: anObject self changeFilters: (self filters copyWith: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterAutoInstall ^[:package | package isInstallable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterAvailable ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterInstalled ^[:package | package isInstalled]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterNotInstalledYet ^[:package | package isInstalled not]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:42'! filterNotUptoDate ^[:package | package isAvailable]! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 11/22/2006 15:02'! filterPublished ^[:package | package isPublished]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filterRemove: anObject self changeFilters: (self filters copyWithout: anObject) ! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterSafelyAvailable ^[:package | package isSafelyAvailable]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/30/2006 21:07'! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #(#('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.') ) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ' , (map object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoaderPlus methodsFor: 'filters' stamp: 'btr 12/1/2006 01:43'! filterVersion "Ignore spaces in the version string, they're sometimes spurious. Not used anymore." ^[:package | package categories anySatisfy: [:cat | (cat name, '*') match: (Smalltalk version copyWithout: $ ) ]]! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! filters ^filters! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/24/2006 13:49'! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description. " | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^ self]. descriptions := self packageList collect: [:e | e description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^ self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 18:36'! hasSelectedItem ^ self selectedPackageOrRelease notNil! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by versions: (installed -> latest). If there is no arrow, your installed version of the package is the latest. Bold packages and releases have been installed. The checkbox menu items modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. Comment on a package by emailing the author or the squeak list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://wiki.squeak.org/2726' asUrl]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! informException: ex msg: msg "Tell the user that an error has occurred. Offer to open debug notifier." (self confirm: msg, 'Would you like to open a debugger?') ifTrue: [ex pass]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/5/2006 05:28'! initialExtent ^500@400! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:53'! installPackageRelease: aRelease "Install a package release. The cache is used." | myRelease installer | aRelease isCompatibleWithCurrentSystemVersion ifFalse: [(self confirm: 'The package you are about to install is not listed as being compatible with your image version (', SystemVersion current majorMinorVersion, '), so the package may not work properly. Do you still want to proceed with the install?') ifFalse: [^ self]]. myRelease := self installedReleaseOfMe. installer := SMInstaller forPackageRelease: aRelease. [UIManager default informUser: 'Downloading ' , aRelease asString during: [installer download]. UIManager default informUser: 'Installing ' , aRelease asString during: [ installer install. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 15:02'! installedReleaseOfMe "Return the release of the installed package loader." ^SMSqueakMap default installedReleaseOf: (SMSqueakMap default packageWithId: '941c0108-4039-4071-9863-a8d7d2b3d4a3').! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:44'! itemChildren: anItem ^ anItem isPackage ifTrue: [anItem releases] ifFalse: [#()]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 19:56'! itemDescription ^ self selectedPackageOrRelease ifNil: ['<No package selected>'] ifNotNilDo: [:item | item fullDescription]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:45'! itemHasChildren: anItem ^ anItem isPackage and: [anItem releases notEmpty]! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:44'! itemLabel: anItem | label | label := anItem isPackage ifTrue: [anItem name , (anItem versionLabel ifEmpty: [''] ifNotEmptyDo: [:lbl | ' (' , anItem versionLabel , ')'])] ifFalse: [anItem smartVersion]. ^ anItem isInstalled ifTrue: [label asText allBold] ifFalse: [label]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 11/24/2006 17:17'! label ^ self labelForShown: (packagesList ifNil: [self packageList])! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! labelForFilter: aFilterSymbol ^(self filterSpecs detect: [:fs | fs second = aFilterSymbol]) first! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! labelForShown: packagesShown "Update the label of the window." ^ self defaultLabel , ' (', (packagesShown size < map packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , map packages size printString, ' packages)'! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! listInPasteBuffer "Useful when talking with people etc. Uses the map to produce a nice String." Clipboard clipboardText: (String streamContents: [:s | packagesList do: [:p | s nextPutAll: p nameWithVersionLabel; cr ]]) asText! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:31'! loadUpdates [UIManager default informUser: 'Loading Updates' during: [ map loadUpdates. self noteChanged ] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when updating map:\', ex messageText, '\') withCRs]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/24/2006 14:05'! noteChanged filters ifNil: [^ self reOpen]. map ifNotNil: [packagesList := nil. selectedCategory := nil. self changed: #categoryList. self changed: #packageList. self changed: #packagesListIndex. "update my selection" self contentsChanged]! ! !SMLoaderPlus methodsFor: 'initialization' stamp: 'btr 11/22/2006 16:11'! on: aSqueakMap "Initialize instance." map := aSqueakMap. map synchWithDisk. filters := DefaultFilters copy. categoriesToFilterIds := DefaultCategoriesToFilterIds copy. self askToLoadUpdates! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! package: aPackage filteredByCategory: aCategory "Answer true if the package should be shown if we filter on <aCategory>. It should be shown if itself or any of its releases has the category." | releases | releases := aPackage releases. ^(aPackage hasCategoryOrSubCategoryOf: aCategory) or: [ releases anySatisfy: [:rel | rel hasCategoryOrSubCategoryOf: aCategory]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list | list := packagesList ifNil: [packagesList := self packageListCalculated]. selectedCategory ifNotNil: [ list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^ list! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:49'! packageListCalculated "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." ^ self packages select: [:p | filters allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [self package: p filteredByCategory: (map object: currFilter)]]]! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! packageNameList ^ self packageList collect: [:e | e name]! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 18:30'! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: (self commandSpecFor: #installPackageRelease)]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: (self commandSpecFor: #browseCacheDirectory)]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: (self commandSpecFor: #cachePackageReleaseAndOfferToCopy). choices add: (self commandSpecFor: #downloadPackageRelease)]. choices add: (self commandSpecFor: #emailPackageMaintainers). ^ choices! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/22/2006 16:11'! packages "We request the packages as sorted by name by default." ^map packagesByName asArray ! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex ^ self packageList indexOf: self selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:01'! packagesListIndex: anObject self selectedItem: (anObject = 0 ifFalse: [self packageList at: anObject])! ! !SMLoaderPlus methodsFor: 'menus' stamp: 'btr 11/22/2006 15:02'! packagesMenu: aMenu "Answer the packages-list menu." self selectedPackageOrRelease ifNotNil: [aMenu addList: self packageSpecificOptions; addLine]. aMenu addList: self generalOptions. self addFiltersToMenu: aMenu. ^aMenu! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 12/1/2006 01:45'! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." ^ (self respondsTo: selector) ifTrue: [self perform: selector] ifFalse: [super perform: selector orSendTo: otherTarget]! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 11/26/2006 23:22'! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. window delete. (Smalltalk at: self class name) open! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeCategoryFilters "Remove all category filters." categoriesToFilterIds := OrderedCollection new! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! removeSelectedCategoryAsFilter "Remove the filter that filters on the currently selected category." categoriesToFilterIds remove: self selectedCategory id! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! saveFiltersAsDefault "Save the current filters as default so that they are selected the next time the loader is opened." DefaultFilters := filters copy. DefaultCategoriesToFilterIds := categoriesToFilterIds copy! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchSelection "Selects all of the default search text so that a type-in overwrites it." ^ {1. self searchText size}! ! !SMLoaderPlus methodsFor: 'interface' stamp: 'btr 11/24/2006 14:35'! searchText "A dummy default search text so that the field describes its purpose." ^ 'Search packages'! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedCategory "Return selected category." ^ selectedCategory! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:37'! selectedCategory: anSMCategory "Change the selected category." selectedCategory := anSMCategory. selectedCategory ifNotNil: [(selectedCategory objects includes: self selectedItem) ifFalse: [self selectedItem: nil]]. self changed: #selectedCategory. self changed: #packageList! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:52'! selectedCategoryPath "Return selected category's path." | path | path := #(). selectedCategory ifNotNil: [selectedCategory parent ifNotNilDo: [:p | path := path copyWith: p]. path := path copyWith: selectedCategory]. ^ path collect: [:cat | self categoryLabel: cat]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:02'! selectedItem ^ selectedItem! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:27'! selectedItem: anItem "This == workaround protects us from recursion since ToolBuilder's tree widgets will always tell us that the selection has been updated when we tell it that the selection path has been updated. Cleaner solutions invited." anItem == selectedItem ifFalse: [ selectedItem := anItem. self changed: #selectedItemPath. self changed: #itemDescription. self changed: #hasSelectedItem]! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 12/1/2006 16:16'! selectedItemPath | path | path := #(). (selectedItem isKindOf: SMPackageRelease) ifTrue: [path := path copyWith: selectedItem package]. selectedItem ifNotNil: [path := path copyWith: selectedItem]. ^ path! ! !SMLoaderPlus methodsFor: 'accessing' stamp: 'btr 11/24/2006 14:03'! selectedPackageOrRelease "Return selected package or package release." ^ selectedItem! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! showFilterString: aFilterSymbol ^(self stateForFilter: aFilterSymbol), (self labelForFilter: aFilterSymbol)! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! stateForFilter: aFilterSymbol ^(self filters includes: aFilterSymbol) ifTrue: ['<yes>'] ifFalse: ['<no>'] ! ! !SMLoaderPlus methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 15:02'! toggleFilterState: aFilterSymbol ^(self filters includes: (aFilterSymbol)) ifTrue: [self filterRemove: aFilterSymbol] ifFalse: [self filterAdd: aFilterSymbol]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! uncheckFilters "Uncheck all filters." filters := OrderedCollection new. self noteChanged! ! !SMLoaderPlus methodsFor: 'lists' stamp: 'btr 12/1/2006 01:50'! updateLabel: packagesShown "Update the label of the window." window ifNotNilDo: [:w | w setLabel: (self labelForShown: packagesShown)]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [ map upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. Confirms on each upgrade." ^ self upgradeInstalledPackagesConfirm: true! ! !SMLoaderPlus methodsFor: 'private' stamp: 'btr 12/1/2006 01:29'! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade. " | installed old myRelease toUpgrade info | installed := map installedPackages. old := map oldPackages. old isEmpty ifTrue: [^ self inform: 'All ' , installed size printString , ' installed packages are up to date.']. toUpgrade := map upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [^ self inform: 'None of the ' , old size printString , ' old packages of the ' , installed size printString , ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: ['Of the ' , old size printString , ' old packages only ' , toUpgrade size printString , ' can be upgraded. The following packages will not be upgraded: ' , (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info , ' About to upgrade the following packages: ' , (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]) , 'Proceed?') ifTrue: [myRelease := self installedReleaseOfMe. [UIManager default informUser: 'Upgrading Installed Packages' during: [confirmEach ifTrue: [map upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ' , p installedRelease packageNameWithVersion , ' to ' , (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName , '?']] ifFalse: [map upgradeOldPackages]. self inform: toUpgrade size printString , ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifTrue: [self noteChanged] ifFalse: [self reOpen]]] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\' , ex messageText , '\') withCRs]]! ! !SMLoaderPlus methodsFor: 'actions' stamp: 'btr 11/22/2006 15:02'! upgradeInstalledPackagesNoConfirm "Tries to upgrade all installed packages to the latest published release for this version of Squeak. No confirmation on each upgrade." ^ self upgradeInstalledPackagesConfirm: false! ! !SMPackageWrapper methodsFor: 'comparing' stamp: 'dvf 9/21/2003 16:25' prior: 27998626! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMPackageWrapper methodsFor: 'converting' stamp: 'btr 11/22/2006 00:54' prior: 27998778! asString | string | string := item name, ' (', item versionLabel, ')'. item isInstalled ifTrue: [string := string asText allBold]. "(string includesSubString: '->') ifTrue: [string := string asText color: Color green]." ^ string! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'dvf 10/14/2003 18:58' prior: 27998902! contents ^item releases reversed collect: [:e | SMPackageReleaseWrapper with: e]! ! !SMPackageWrapper methodsFor: 'testing' stamp: 'dvf 9/21/2003 16:25' prior: 27999070! hash ^self withoutListWrapper hash! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:55'! help ^ 'This shows all packages with their releases that should be displayed according the current filter.'! ! !SMPackageWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString! ! !SMPackageWrapper methodsFor: 'printing' stamp: 'dvf 9/21/2003 16:22' prior: 27999192! printOn: aStream aStream nextPutAll: 'wrapper for: ', item printString! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849043! = anObject ^self withoutListWrapper = anObject withoutListWrapper! ! !SMCategoryWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 18:53' prior: 27849195! asString ^ item name , ' (' , self numberOfObjects printString , ')'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'ar 2/9/2004 02:35' prior: 27849301! category ^item! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 21:02' prior: 27849402! contents ^ item subCategories collect: [:n | self class with: n model: n]! ! !SMCategoryWrapper methodsFor: 'model access' stamp: 'btr 11/30/2006 21:02'! getList ^ Array with: (self class with: self contents model: model)! ! !SMCategoryWrapper methodsFor: 'testing' stamp: 'btr 11/30/2006 18:53'! hasContents ^ item hasSubCategories! ! !SMCategoryWrapper methodsFor: 'comparing' stamp: 'ar 2/9/2004 02:13' prior: 27849700! hash ^self withoutListWrapper hash! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:56'! help ^ 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'BJP 11/22/2002 14:17'! model ^model! ! !SMCategoryWrapper methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:53'! numberOfObjects " | total | total _ 0. model allCategoriesDo: [:c | total _ total + c objects size]. ^total" ^item objects size! ! !SMPackageReleaseWrapper methodsFor: 'converting' stamp: 'btr 11/30/2006 21:30' prior: 27997393! asString "Show installed releases with a trailing asterisk." | string | string := item smartVersion. "Older SMBase versions don't have isInstalled.'" (item respondsTo: #isInstalled) ifTrue: [item isInstalled ifTrue: [string := (string , ' *') asText allBold]]. ^ string! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 17:14'! contents ^ #()! ! !SMPackageReleaseWrapper methodsFor: 'accessing' stamp: 'btr 11/22/2006 16:49'! label ^ self asString ! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 12/1/2006 15:47' prior: 27944626! initialize "Hook us up in the world menu." "self initialize" Smalltalk at: #ToolBuilder ifAbsent: [self registerInFlapsRegistry. (Preferences windowColorFor: #SMLoader) = Color white ifTrue: ["not set" Preferences setWindowColorFor: #SMLoader to: (Color colorFrom: self windowColorSpecification brightColor)]. (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [| oldCmds | oldCmds := TheWorldMenu registry select: [:cmd | cmd first includesSubString: 'Package Loader']. oldCmds do: [:cmd | TheWorldMenu unregisterOpenCommand: cmd first]. TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]. DefaultFilters := OrderedCollection new. DefaultCategoriesToFilterIds := OrderedCollection new! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52'! openMenuString ^ 'SqueakMap Catalog'! ! !SMLoader class methodsFor: 'class initialization' stamp: 'btr 11/30/2006 21:52' prior: 27945298! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self environment at: #Flaps ifPresent: [:cl | cl unregisterQuadsWithReceiver: self] ! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:08' prior: 54331069! addFiltersToMenu: aMenu | filterSymbol help | self filterSpecs do: [:filterArray | filterSymbol := filterArray second. help := filterArray third. aMenu addUpdating: #showFilterString: target: self selector: #toggleFilterState: argumentList: (Array with: filterSymbol). aMenu balloonTextForLastItem: help]. aMenu addLine; addList: #(('Clear all filters' uncheckFilters 'Unchecks all filters to list all packages')) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:15' prior: 27927912! browseCacheDirectory "Open a FileList2 on the directory for the package or release." | item dir win | item := self selectedPackageOrRelease ifNil: [^ nil]. item ifNil: [^nil]. dir := item isPackage ifTrue: [model cache directoryForPackage: item] ifFalse: [model cache directoryForPackageRelease: item]. win := FileList2 morphicViewOnDirectory: dir. " withLabel: item name, ' cache directory'." win openInWorld ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:52'! buildButtonBar | aRow btn | aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. self buttonSpecs do: [:spec | btn := self buildButtonNamed: spec first helpText: spec third action: spec second. aRow addMorphBack: btn] separatedBy: [aRow addTransparentSpacerOfSize: 3@0]. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 01:27'! buildButtonNamed: labelText helpText: balloon action: action | btn | btn := PluggableButtonMorph on: self getState: nil action: action. btn color: Color transparent; hResizing: #shrinkWrap; vResizing: #spaceFill; label: labelText; setBalloonText: balloon; onColor: Color transparent offColor: Color transparent. ^ btn! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 19:04' prior: 27928394! buildMorphicCategoriesList "Create the hierarchical list holding the category tree." | list | list := (SimpleHierarchicalListMorph on: self list: #categoryWrapperList selected: #selectedCategoryWrapper changeSelected: #selectedCategoryWrapper: menu: #categoriesMenu: keystroke: nil) autoDeselect: true; enableDrag: false; enableDrop: true; yourself. list setBalloonText: 'The categories are structured in a tree. Packages and package releases belong to several categories. You can add one or more categories as filters and enable them in the menu.'. "list scroller submorphs do:[:each| list expandAll: each]." list adjustSubmorphPositions. ^ list! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:22' prior: 27929139! buildMorphicPackagesList "Create the hierarchical list holding the packages and releases." ^(SimpleHierarchicalListMorph on: self list: #packageWrapperList selected: #selectedItemWrapper changeSelected: #selectedItemWrapper: menu: #packagesMenu: keystroke: nil) autoDeselect: false; enableDrag: false; enableDrop: true; setBalloonText: 'This shows all packages with their releases that should be displayed according the current filter.'; yourself! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:13'! buildPackageButtonBar | aRow | "Somewhat patterned after IRCe's buttonRow method." aRow := AlignmentMorph newRow beSticky. aRow color: Color transparent; clipSubmorphs: true. ^ aRow! ! !SMLoader methodsFor: 'interface' stamp: 'gk 5/5/2006 02:05' prior: 27929686! buildPackagePane "Create the text area to the right in the loader." | ptm | ptm := PluggableTextMorph on: self text: #contents accept: nil readSelection: nil "#packageSelection " menu: nil. ptm setBalloonText: 'This is where the selected package or package release is displayed.'. ptm lock. ^ptm! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 21:08' prior: 27930070! buildSearchPane "Cribbed from MessageNames>>inMorphicWindowWithInitialSearchString:" | typeInView searchButton typeInPane | typeInView := PluggableTextMorph on: self text: nil accept: #findPackage:notifying: readSelection: nil menu: nil. typeInView acceptOnCR: true; vResizing: #spaceFill; hResizing: #spaceFill; setTextMorphToSelectAllOnMouseEnter; askBeforeDiscardingEdits: false; setProperty: #alwaysAccept toValue: true. (typeInView respondsTo: #hideScrollBarsIndefinitely) ifTrue: [typeInView hideScrollBarsIndefinitely] ifFalse: [typeInView hideScrollBarIndefinitely]. searchButton := SimpleButtonMorph new target: typeInView; color: Color white; label: 'Search'; actionSelector: #accept; arguments: #(); yourself. typeInPane := AlignmentMorph newRow. typeInPane vResizing: #shrinkWrap; hResizing: #shrinkWrap; listDirection: #leftToRight; addMorphFront: searchButton; addTransparentSpacerOfSize: 6 @ 0; addMorphBack: typeInView; setBalloonText: 'Type into the pane, then press Search (or hit RETURN) to visit the next package matching what you typed.'. ^ typeInPane! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 14:24'! buttonSpecs ^ #(('Install' installPackageRelease 'Install the latest version from the server.') ('Email' emailPackageMaintainers 'Open an editor to send an email to the owner and co-maintainers of this package.') ('Browse cache' browseCacheDirectory 'Browse cache directory of the selection.') ('Update' loadUpdates 'Update the package index from the servers.') ('Upgrade All' upgradeInstalledPackagesConfirm 'Upgrade all installed packages (confirming each).') ('Help' help 'What is this?'))! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:11' prior: 27936393! categorySpecificOptions | choices | choices := OrderedCollection new. (categoriesToFilterIds includes: self selectedCategory id) ifTrue: [ choices add: #('Remove filter' #removeSelectedCategoryAsFilter 'Remove the filter for the selected category.')] ifFalse: [ choices add: #('Add as filter' #addSelectedCategoryAsFilter 'Add the selection as a filter to hide unrelated packages.')]. categoriesToFilterIds isEmpty ifFalse: [ choices add: #('Remove all filters' #removeCategoryFilters 'Remove all category filters.')]. ^ choices! ! !SMLoader methodsFor: 'lists' stamp: 'btr 11/30/2006 21:01' prior: 27933585! categoryWrapperList "Create the wrapper list for the hierarchical list. We sort the categories by name but ensure that 'Squeak versions' is first if it exists." | list first | list := (model categories select: [:each | each parent isNil]) asArray sort: [:c1 :c2 | c1 name <= c2 name]. first := list detect: [:any | any name = 'Squeak versions'] ifNone: []. first ifNotNil: [list := list copyWithout: first. list := {first} , list]. ^ list collect: [:cat | SMCategoryWrapper with: cat model: self]! ! !SMLoader methodsFor: 'filter utilities' stamp: 'gk 7/10/2004 15:45' prior: 27913226! changeFilters: anObject "Update my selection." | oldItem index | oldItem := self selectedPackageOrRelease. filters := anObject. self packagesListIndex: ((index := self packageList indexOf: oldItem) ifNil: [0] ifNotNil: [index]). self noteChanged! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/30/2006 17:30' prior: 27930584! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.3. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0.0 @ 0.0 corner: 1.0 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0.0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (0.0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0.0 @ horizDivide corner: vertDivide @ 1.0). self addMorph: (self buildPackagePane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1.0 @ 1.0). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self! ! !SMLoader methodsFor: 'interface' stamp: 'gk 7/12/2004 11:14' prior: 27931214! defaultButtonPaneHeight "Answer the user's preferred default height for new button panes." ^ Preferences parameterAt: #defaultButtonPaneHeight ifAbsentPut: [25]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:01'! defaultLabel ^'SqueakMap Package Loader'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:14' prior: 27917579! emailPackageMaintainers "Send mail to package owner and co-maintainers." | item package toAddresses | item := self selectedPackageOrRelease ifNil: [^ nil]. package := item isPackageRelease ifTrue: [item package] ifFalse: [item]. "(this logic should be moved to MailMessage as soon as it can handle multiple To: addresses)" toAddresses := '<', package owner email, '>'. package maintainers ifNotNil: [ package maintainers do: [:maintainer | toAddresses := toAddresses, ', <', maintainer email, '>']]. SMUtilities sendMailTo: toAddresses regardingPackageRelease: item! ! !SMLoader methodsFor: 'filter utilities' stamp: 'btr 11/22/2006 00:14' prior: 27923782! filterSpecs "Return a specification for the filter menu. Is called each time." | specs | specs := #( #('Auto-installable packages' #filterAutoInstall 'display only packages that can be installed automatically') #('New available packages' #filterAvailable 'display only packages that are not installed or that have newer releases available.') #('New safely-available packages' #filterSafelyAvailable 'display only packages that are not installed or that have newer releases available that are safe to install, meaning that they are published and meant for the current version of Squeak.') #('Installed packages' #filterInstalled 'Display only packages that are installed.') #('Published packages' #filterPublished 'Display only packages that have at least one published release.')) asOrderedCollection. categoriesToFilterIds do: [:catId | specs add: {'Packages in ', (model object: catId) name. catId. 'Display only packages that are in the category.'}]. ^ specs! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 19:27' prior: 27918212! findPackage: aString notifying: aView "Search and select a package with the given (sub) string in the name or description." | index list match descriptions | match := aString asString asLowercase. index := self packagesListIndex. list := self packageNameList. list isEmpty ifTrue: [^self]. descriptions := self packageWrapperList collect: [:e | e withoutListWrapper description]. index + 1 to: list size do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. "wrap around" 1 to: index do: [:i | (((list at: i) includesSubstring: match caseSensitive: false) or: [(descriptions at: i) includesSubstring: match caseSensitive: false]) ifTrue: [^self packagesListIndex: i]]. self inform: 'No package matching ' , aString asString! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/21/2006 16:05' prior: 27937041! generalOptions ^#( #('Upgrade all installed packages' upgradeInstalledPackagesNoConfirm) #('Upgrade all installed packages confirming each' upgradeInstalledPackagesConfirm) #('Put list in paste buffer' listInPasteBuffer) #('Save filters as default' saveFiltersAsDefault) #- ) ! ! !SMLoader methodsFor: 'interface' stamp: 'btr 11/22/2006 00:48' prior: 27931447! help "Present help text. If there is a web server available, offer to open it. Use the WebBrowser registry if possible, or Scamper if available." | message browserClass | message := 'Welcome to the SqueakMap package loader. The names of packages are followed by (installed version -> latest version). If there is no arrow, your installed version of the package is the latest. Installed packages and releases are also in bold. The checkbox menu items at the bottom let you modify which packages you''ll see. Take a look at them - only some packages are shown initially. The options available for a package depend on how it was packaged. If you like a package or have comments on it, please contact the author or the squeak mailing list.'. browserClass := Smalltalk at: #WebBrowser ifPresent: [ :registry | registry default ]. browserClass := browserClass ifNil: [ Smalltalk at: #Scamper ifAbsent: [ ^self inform: message ]]. (self confirm: message, ' Would you like to view more detailed help on the SqueakMap swiki page?') ifTrue: [ browserClass openOnUrl: 'http://minnow.cc.gatech.edu/squeak/2726' asUrl]! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/22/2006 01:13' prior: 27918874! installPackageRelease "Install selected package or release. The cache is used." | item release | item := self selectedPackageOrRelease ifNil: [^ nil]. item isPackageRelease ifTrue: [ (item isPublished or: [self confirm: 'Selected release is not published yet, install anyway?']) ifTrue: [^self installPackageRelease: item]] ifFalse: [ release := item lastPublishedReleaseForCurrentSystemVersion. release ifNil: [ (self confirm: 'The package has no published release for your Squeak version, try releases for any Squeak version?') ifTrue: [ release := item lastPublishedRelease. release ifNil: [ (self confirm: 'The package has no published release at all, take the latest of the unpublished releases?') ifTrue: [release := item lastRelease]]]]. release ifNotNil: [^self installPackageRelease: release]]! ! !SMLoader methodsFor: 'actions' stamp: 'mist 8/17/2005 13:56'! installPackageWithDependents: package | myRelease | myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ package installWithDependencies. myRelease = self installedReleaseOfMe ifFalse: [self reOpen]. self noteChanged] ] on: Error do: [:ex | | msg | msg := ex messageText ifNil:[ex asString]. self informException: ex msg: ('Error occurred during install:\', msg, '\') withCRs].! ! !SMLoader methodsFor: 'initialization' stamp: 'gk 4/5/2005 21:17' prior: 27932588! openAsMorph "Open the loader as a Morphic window." "SMLoader new openAsMorph" ^self createWindow openInWorld! ! !SMLoader methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45' prior: 27934165! packageList "Return a list of the SMPackages that should be visible by applying all the filters. Also filter based on the currently selected category - if any." | list selectedCategory | list := packagesList ifNil: [ packagesList := self packages select: [:p | (filters ifNil: [#()]) allSatisfy: [:currFilter | currFilter isSymbol ifTrue: [(self perform: currFilter) value: p] ifFalse: [ self package: p filteredByCategory: (model object: currFilter)]]]]. selectedCategoryWrapper ifNotNil: [selectedCategory := selectedCategoryWrapper category. list := list select: [:each | self package: each filteredByCategory: selectedCategory]]. self updateLabel: list. ^list! ! !SMLoader methodsFor: 'menus' stamp: 'btr 11/22/2006 14:30' prior: 27937451! packageSpecificOptions | choices packageOrRelease | packageOrRelease := self selectedPackageOrRelease. choices := OrderedCollection new. packageOrRelease isInstallable ifTrue: [ choices add: self buttonSpecs first]. (packageOrRelease isDownloadable and: [packageOrRelease isCached]) ifTrue: [ choices add: self buttonSpecs third]. (packageOrRelease isPackageRelease and: [packageOrRelease isDownloadable]) ifTrue: [ choices add: #('Copy from cache' #cachePackageReleaseAndOfferToCopy 'Download selected release into cache first if needed, and then offer to copy it somewhere else.' ). choices add: #('Force download into cache' #downloadPackageRelease 'Force a download of the selected release into the cache.' )]. choices add: self buttonSpecs second. ^ choices! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 18:56' prior: 27913703! packagesListIndex: anObject self selectedItemWrapper: (anObject ifNotNil: [anObject = 0 ifFalse: [self packageWrapperList at: anObject]])! ! !SMLoader methodsFor: 'interface' stamp: 'gk 4/5/2005 21:43' prior: 27932888! perform: selector orSendTo: otherTarget "Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked." (self respondsTo: selector) ifTrue: [^ self perform: selector] ifFalse: [^ super perform: selector orSendTo: otherTarget]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/26/2006 23:22' prior: 27941030! reOpen "Close this package loader, probably because it has been updated, and open a new one." self inform: 'This package loader has been upgraded and will be closed and reopened to avoid strange side effects.'. self delete. (Smalltalk at: self class name) open! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/30/2006 19:17' prior: 27913904! selectedCategory "Return selected category." ^selectedCategoryWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 12/1/2006 15:51' prior: 27914233! selectedCategoryWrapper: aWrapper selectedCategoryWrapper := aWrapper. (aWrapper notNil and: [aWrapper withoutListWrapper objects includes: selectedItemWrapper withoutListWrapper]) ifFalse: [self selectedItemWrapper: nil]. self changed: #selectedCategoryWrapper. self changed: #packageWrapperList.! ! !SMLoader methodsFor: 'accessing' stamp: 'btr 11/22/2006 19:13' prior: 27914590! selectedItemWrapper: aWrapper selectedItemWrapper := aWrapper. self changed: #selectedItemWrapper. self contentsChanged! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:10' prior: 27941340! selectedPackageOrRelease "Return selected package or package release." ^self selectedItemWrapper ifNotNilDo: [:w | w withoutListWrapper]! ! !SMLoader methodsFor: 'interface' stamp: 'btr 12/1/2006 02:02' prior: 27935346! updateLabel: packagesShown "Update the label of the window." self setLabel: self defaultLabel , ' (', (packagesShown size < model packages size ifTrue: [packagesShown size printString, ' shown out of '] ifFalse: ['']) , model packages size printString, ' packages)'! ! !SMLoader methodsFor: 'actions' stamp: 'btr 11/30/2006 21:03' prior: 27921197! upgradeInstalledPackages "Tries to upgrade all installed packages to the latest published release for this version of Squeak. So this is a conservative approach." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ model upgradeOldPackages. self inform: toUpgrade size printString, ' packages successfully upgraded.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoader methodsFor: 'private' stamp: 'btr 11/30/2006 21:03' prior: 27941568! upgradeInstalledPackagesConfirm: confirmEach "Tries to upgrade all installed packages to the latest published release for this version of Squeak. If confirmEach is true we ask for every upgrade." | installed old myRelease toUpgrade info | installed := model installedPackages. old := model oldPackages. old isEmpty ifTrue: [ ^self inform: 'All ', installed size printString, ' installed packages are up to date.']. toUpgrade := model upgradeableAndOldPackages. toUpgrade isEmpty ifTrue: [ ^self inform: 'None of the ', old size printString, ' old packages of the ', installed size printString, ' installed can be automatically upgraded. You need to upgrade them manually.']. info := old size < toUpgrade size ifTrue: [ 'Of the ', old size printString, ' old packages only ', toUpgrade size printString, ' can be upgraded. The following packages will not be upgraded: ', (String streamContents: [:s | (old removeAll: toUpgrade; yourself) do: [:p | s nextPutAll: p nameWithVersionLabel; cr]])] ifFalse: ['All old packages upgradeable.']. (self confirm: info, ' About to upgrade the following packages: ', (String streamContents: [:s | toUpgrade do: [:p | s nextPutAll: p nameWithVersionLabel; cr]]), 'Proceed?') ifTrue: [ myRelease := self installedReleaseOfMe. [Cursor wait showWhile: [ confirmEach ifTrue: [ model upgradeOldPackagesConfirmBlock: [:p | self confirm: 'Upgrade ', p installedRelease packageNameWithVersion, ' to ', (p lastPublishedReleaseForCurrentSystemVersionNewerThan: p installedRelease) listName, '?']] ifFalse: [model upgradeOldPackages]. self inform: toUpgrade size printString, ' packages successfully processed.'. myRelease = self installedReleaseOfMe ifFalse: [self reOpen] ifTrue: [self noteChanged]] ] on: Error do: [:ex | self informException: ex msg: ('Error occurred when upgrading old packages:\', ex messageText, '\') withCRs]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 12/1/2006 18:06'! initialize Smalltalk at: #ToolBuilder ifAbsent: [ (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {self openMenuString. {self. #open}}]]! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! openMenuString ^ 'SqueakMap Categories'! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! removeFromSystem (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString]. self removeFromSystem: true! ! !SMLoaderCategorical class methodsFor: 'menu registration' stamp: 'btr 11/30/2006 21:51'! unload (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu unregisterOpenCommand: self openMenuString].! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #installedPackageNameList selected: #installedPackagesListIndex changeSelected: #installedPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 11/30/2006 18:58'! buildMorphicNotInstalledPackagesList | list | (list := PluggableListMorph new) on: self list: #notInstalledPackageNameList selected: #notInstalledPackagesListIndex changeSelected: #notInstalledPackagesListIndex: menu: #packagesMenu: keystroke: #packagesListKey:from:. ^ list! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createFancyWindow "Creates a variant of the window where the package pane is split between installed and uninstalled packages." | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildSearchPane borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ searchHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ (buttonBarHeight + searchHeight) corner: vertDivide @ horizDivide). self addMorph: (self buildMorphicNotInstalledPackagesList borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (horizDivide / 2)). self addMorph: (self buildMorphicInstalledPackagesList borderWidth: 0) frame: (vertDivide @ (horizDivide / 2) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setUpdatablePanesFrom: #(#installedPackageNameList #notInstalledPackageNameList ). currentPackageList := #notInstalled. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! createWindow | buttonBarHeight searchHeight vertDivide horizDivide | buttonBarHeight := 0.07. searchHeight := 0.07. vertDivide := 0.5. horizDivide := 0.6. self addMorph: (self buildButtonBar borderWidth: 0) frame: (0 @ 0 corner: 1 @ buttonBarHeight). self addMorph: (self buildMorphicCategoriesList borderWidth: 0) frame: (0 @ buttonBarHeight corner: vertDivide @ horizDivide). self addMorph: (self buildSearchPane borderWidth: 0) frame: (vertDivide @ buttonBarHeight corner: 1 @ (buttonBarHeight + searchHeight)). self addMorph: (self buildMorphicPackagesList borderWidth: 0) frame: (vertDivide @ (buttonBarHeight + searchHeight) corner: 1 @ horizDivide). self addMorph: (self buildPackagePane borderWidth: 0) frame: (0 @ horizDivide corner: 1 @ 1). self on: #mouseEnter send: #paneTransition: to: self. self on: #mouseLeave send: #paneTransition: to: self. self setLabel: self defaultLabel! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 17:27'! currentPackageList ^currentPackageList! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'btr 11/30/2006 17:44'! currentPackageList: aSymbol currentPackageList := aSymbol. self changed: #installButtonLabel.! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:56'! defaultLabel ^ 'SqueakMap Categorical Package Loader'! ! !SMLoaderCategorical methodsFor: 'interface' stamp: 'btr 12/4/2006 15:58'! installButtonLabel ^ self currentPackageList = #notInstalled ifTrue: ['Install the above package'] ifFalse: ['Remove the above package']! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! installedPackageNameList ^self packageList select: [:e | e isInstalled]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! installedPackagesListIndex self currentPackageList = #installed ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! installedPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #installed ifTrue: [self currentPackageList: #installed. self changed: #currentPackageList]. self noteChanged! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 15:09'! isOn ^false! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 11/30/2006 20:20'! notInstalledPackageNameList ^self packageList select: [:e | e isInstalled not]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 13:58'! notInstalledPackagesListIndex self currentPackageList = #notInstalled ifTrue: [^ self packagesListIndex] ifFalse: [^ 0]! ! !SMLoaderCategorical methodsFor: 'accessing' stamp: 'BJP 11/25/2002 14:35'! notInstalledPackagesListIndex: anObject packagesListIndex := anObject. self currentPackageList ~= #notInstalled ifTrue: [self currentPackageList: #notInstalled. self changed: #currentPackageList]. self changed: #packagesListIndex. "update my selection" self noteChanged. self contentsChanged! ! !SMLoaderCategorical methodsFor: 'private' stamp: 'btr 11/30/2006 20:21'! noteChanged self changed: #installedPackageNameList. self changed: #notInstalledPackageNameList. super noteChanged." self changed: #packageNameList. self changed: #packagesListIndex. self changed: #categoriesForPackage. self contentsChanged."! ! !SMLoaderCategorical methodsFor: 'lists' stamp: 'btr 12/1/2006 16:45'! packageList ^ self packages select: [:e | (e categories anySatisfy: [:cat | cat = self selectedCategory]) and: [(filters ifNil: [#()]) allSatisfy: [:currFilter | (self perform: currFilter) value: e]]]! ! SMLoader removeSelector: #paneColorOld! SMLoader removeSelector: #addPackagesTo:at:plus:! "SMLoader"! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! ----STARTUP----{19 April 2010 . 12:31:46 am} as /Users/bert/Downloads/Squeak4.1/Squeak4.1.image! Smalltalk removeClassNamed: #MCMockClassC! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 59339410! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066043! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066175! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 57066304! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066431! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 57066565! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 57066689! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066783! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066859! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 57066935! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 57067021! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 57067115! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 57067217! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 57067420! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 57067488! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 57067587! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 23101866! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 57068777! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 57068888! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 59339563! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 57067679! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33645350! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645710! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33645842! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33645971! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646098! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33646232! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33646356! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646450! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646526! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33646602! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33646688! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33646782! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33646884! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33647080! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33647148! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33647247! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33647351! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33647608! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33647869! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33648753! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33648927! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653416! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33653555! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653766! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654029! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654165! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654418! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654514! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654737! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33654832! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655111! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33655198! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33655388! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33656020! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656135! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33649269! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649629! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33649761! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33649890! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650017! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33650151! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33650275! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654610! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33654309! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33653921! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33650701! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33650803! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33656527! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33650999! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33655542! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33656315! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33651270! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33651527! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33651788! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33652672! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33652846! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 57169526! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668453! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33668066! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33668558! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33668861! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33668971! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669096! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:32' prior: 33669221! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669331! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:32' prior: 24924985! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33669536! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669436! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:32' prior: 33669756! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669881! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:32' prior: 33669986! override ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33666466! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667021! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667137! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33667250! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667361! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33667479! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33667587! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667655! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667705! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33667755! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33667815! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33667893! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33667979! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33668150! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33668192! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33668275! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33666736! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33666835! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33666930! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33666619! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33668351! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33670377! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670737! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33670869! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33670998! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671125! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33671259! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33671383! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671477! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671553! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33671629! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33671715! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33671809! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33671911! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33672107! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33672175! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33672274! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33672378! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33672635! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33672896! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33673780! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33673954! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! !MCMockClassC commentStamp: 'tester-MCMockClassC 1/1/2000 00:00' prior: 0! This is a comment for MCMockClassC! Smalltalk removeClassNamed: #MCMockClassC! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 0! d ^ 'd'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678598! a ^ 'a1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33678737! d ^ 'd1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33678948! d ^ 'd'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679211! b ^ 'b'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679347! b ^ 'b1'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! a ^ 'a2'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679600! a ^ 'a1'! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679696! a ^ 'a2'! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679919! one ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33680014! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680293! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33680380! two ^ 3! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 0! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33680570! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33681202! one ^ 2! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681317! one ^ 1! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 0! two ^ 2! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! "MonticelloMocks"! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 0! one ^ 1! ! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 33674296! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674656! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33674788! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31' prior: 33674917! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675044! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21' prior: 33675178! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47' prior: 33675302! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679792! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 33679491! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric' stamp: '' prior: 0! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified' stamp: '' prior: 33679103! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49' prior: 33675728! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21' prior: 33675830! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26' prior: 33681709! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14' prior: 33676026! q! ! !MCMockClassA methodsFor: 'boolean' stamp: '' prior: 33680724! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59' prior: 33681497! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21' prior: 33676297! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21' prior: 33676554! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22' prior: 33676815! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 33677699! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21' prior: 33677873! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! SystemOrganization addCategory: 'Monticello-Mocks'! MCMock subclass: #MCMockClassA instanceVariableNames: 'ivar' classVariableNames: 'CVar' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! MCMockClassA subclass: #MCMockASubclass instanceVariableNames: 'x' classVariableNames: 'Y' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! Object subclass: #MCMockClassD instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! Object variableSubclass: #MCMockClassE instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! Object subclass: #MCMockClassF instanceVariableNames: '' classVariableNames: 'Foo' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableWordSubclass: #MCMockClassG instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object variableByteSubclass: #MCMockClassH instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! Object weakSubclass: #MCMockClassI instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Monticello-Mocks'! MCMock subclass: #MCMockClassB instanceVariableNames: 'ivarb' classVariableNames: 'CVar' poolDictionaries: 'MCMockAPoolDictionary' category: 'Tests-Monticello-Mocks'! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! MCMockClassB class instanceVariableNames: 'ciVar'! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! MCMockClassA initialize! ----End fileIn of a stream----! MCMockClassB removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassB! MCMockClassA removeSelector: #two! MCMockClassA removeSelector: #truth! MCMockClassA removeSelector: #q! MCMockClassA removeSelector: #one! MCMockClassA removeSelector: #moreTruth! MCMockClassA removeSelector: #falsehood! MCMockClassA removeSelector: #d! MCMockClassA removeSelector: #c! MCMockClassA removeSelector: #b! MCMockClassA removeSelector: #a! MCMockClassA class removeSelector: #touchCVar! MCMockClassA class removeSelector: #one! MCMockClassA class removeSelector: #initialize! MCMockClassA class removeSelector: #cVar! MCMockASubclass removeSelector: #variables2! MCMockASubclass removeSelector: #variables! Smalltalk removeClassNamed: #MCMockASubclass! Smalltalk removeClassNamed: #MCMockClassA! Smalltalk removeClassNamed: #MCMockClassI! Smalltalk removeClassNamed: #MCMockClassH! Smalltalk removeClassNamed: #MCMockClassG! Smalltalk removeClassNamed: #MCMockClassF! MCMockClassE class removeSelector: #two! Smalltalk removeClassNamed: #MCMockClassE! MCMockClassD removeSelector: #one! Smalltalk removeClassNamed: #MCMockClassD! MCSnapshotTest removeSelector: #mockClassExtension! !MCMockClassA commentStamp: 'cwp 8/10/2003 16:43' prior: 0! This is a mock class. The Monticello tests manipulated it to simulate a developer modifying code in the image.! !MCMockClassB commentStamp: '' prior: 0! This comment has a bang!! Bang!! Bang!!! !MCSnapshotTest methodsFor: '*monticello-mocks' stamp: 'ab 7/7/2003 23:21'! mockClassExtension! ! !MCMockClassD methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:21'! one ^ 1! ! !MCMockClassE class methodsFor: 'as yet unclassified' stamp: 'cwp 7/8/2003 21:22'! two ^ 2! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables ^ x + Y + MCMockClassA! ! !MCMockASubclass methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! variables2 ^ ivar + CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'cwp 8/10/2003 02:31'! cVar ^ CVar! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! initialize CVar := #initialized! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'ab 7/7/2003 23:21'! one ^ 1! ! !MCMockClassA class methodsFor: 'as yet unclassified' stamp: 'stephaneducasse 2/4/2006 20:47'! touchCVar CVar := #touched! ! !MCMockClassA methodsFor: 'numeric'! a ^ 'a2'! ! !MCMockClassA methodsFor: 'numeric'! b ^ 'b1'! ! !MCMockClassA methodsFor: 'numeric'! c ^ 'c1'! ! !MCMockClassA methodsFor: 'as yet classified'! d ^ 'd'! ! !MCMockClassA methodsFor: 'boolean' stamp: 'cwp 7/13/2003 02:49'! falsehood ^ false! ! !MCMockClassA methodsFor: 'boolean' stamp: 'ab 7/7/2003 23:21'! moreTruth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMockClassA methodsFor: 'drag''n''drop' stamp: 'avi 9/23/2003 17:14'! q! ! !MCMockClassA methodsFor: 'boolean'! truth ^ true! ! !MCMockClassA methodsFor: 'numeric' stamp: 'avi 9/11/2004 15:59'! two ^ 2! ! !MCMockClassB methodsFor: 'numeric' stamp: 'ab 7/7/2003 23:21'! two ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33670091! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693635! override ^ 1! ! !MCMockClassA methodsFor: 'as yet unclassified' stamp: '' prior: 33693248! one ^2! ! MCMockClassA removeSelector: #one! !MCMockClassA methodsFor: 'numeric' stamp: 'cwp 8/2/2003 17:26'! one ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33693740! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694043! override ^ 2! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694153! override ^ 3! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694278! override ^ 4! ! !MCMethodDefinitionTest methodsFor: '*foobarbaz' stamp: 'bf 4/19/2010 00:33' prior: 33694403! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694513! override ^ 1! ! !Object methodsFor: '*monticellomocks' stamp: 'bf 4/19/2010 00:33' prior: 33669632! yourself ^ self! ! !Object methodsFor: 'accessing' stamp: 'md 5/16/2006 12:34' prior: 33694718! yourself "Answer self." ^self! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33694618! override ^ 1! ! !MCMethodDefinitionTest methodsFor: '*monticellomocks-override' stamp: 'bf 4/19/2010 00:33' prior: 33694938! override ^ 2! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695063! override ^ 1! ! !MCMethodDefinitionTest methodsFor: 'mocks' stamp: 'bf 4/19/2010 00:33' prior: 33695168! override ^ 1! ! ----STARTUP----{29 April 2010 . 11:05:03 am} as /Users/bert/Downloads/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{29 April 2010 . 11:05:16 am} Squeak4.1.image priorSource: 229! ----STARTUP----{27 April 2011 . 11:47:16 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----SNAPSHOT----{27 April 2011 . 6:01:18 pm} Pacman.image priorSource: 229! ----QUIT----{27 April 2011 . 6:01:51 pm} Pacman.image priorSource: 141204! ----STARTUP----{27 April 2011 . 6:04:35 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Field instanceVariableNames:'' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Pacman instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #EmptyField instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Field subclass: #Wall instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! ----QUIT----{27 April 2011 . 7:38:58 pm} Squeak4.1.image priorSource: 141281! ----STARTUP----{27 April 2011 . 7:39:01 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT----{27 April 2011 . 8:19:22 pm} Squeak4.1.image priorSource: 142242! ----STARTUP----{28 April 2011 . 1:07:38 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields "Answer the value of fields" ^ fields! ! !Map methodsFor: 'accessing' stamp: 'abc 4/28/2011 13:17'! fields: anObject "Set the value of fields" fields := anObject! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:19'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:19'! setUpMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:27' prior: 33697668! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:27'! initializeMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:29' prior: 33698196! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:29'! fdf ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! PacmanServiceProvider removeSelector: #setUpMap! PacmanServiceProvider removeSelector: #initializeMap! PacmanServiceProvider removeSelector: #fdf! Smalltalk removeClassNamed: #PacmanServiceProvider! !PacmanServiceProvider class methodsFor: 'initialization' stamp: 'abc 4/28/2011 13:44'! initialize ServiceRegistry buildProvider: self new! ! !PacmanServiceProvider methodsFor: 'services' stamp: 'abc 4/28/2011 13:44'! initMap ^ ServiceAction "Open the service browser to set the menu position and the keyboard shortcut" text: 'fill menu label' button: 'short button text' description: 'longer text for balloon help' action: [:r | "action block"] condition: [:r | "optional condition block"]! ! Smalltalk removeClassNamed: #PacmanServiceProvider! !Map methodsFor: 'nil' stamp: 'abc 4/28/2011 13:59'! initMap self inform: 'Hello, World!!'. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 14:01' prior: 33699968! initMap self inform: 'Hello, World!!'.! ! Object subclass: #Map instanceVariableNames: 'fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:32' prior: 33700098! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:43' prior: 33700358! initMap self inform: 'Hello, World!!'. n := 50. m := 100. ^self.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/28/2011 16:45' prior: 33700506! initMap self inform: 'Hello, World!!'. n := 50. m := 100.! ! ----QUIT----{28 April 2011 . 11:54:29 pm} Squeak4.1.image priorSource: 142450! ----STARTUP----{29 April 2011 . 7:49:40 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 19:56' prior: 33700662! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:01'! initialize super initialize. self initMap.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:05' prior: 33701019! initMap self inform: 'Hello, World!!'. n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'nil' stamp: 'abc 4/29/2011 20:24'! main | m | m := Map new.! ! !Map methodsFor: 'initialize-release' stamp: 'abc 4/29/2011 20:25' prior: 33701337! initMap n := 50. m := 100. fields := Array new: m. fields do: [:each | each := Array new: n].! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 4/29/2011 20:25' prior: 33701523! main | m | m := Map new. self inform: 'Hello, World!!'.! ! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! ----QUIT----{30 April 2011 . 12:40:44 am} Squeak4.1.image priorSource: 146293! ----STARTUP----{10 May 2011 . 11:55:01 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 11:56' prior: 33701823! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! main! main! ----SNAPSHOT----{10 May 2011 . 12:48:51 pm} Squeak4.1.image priorSource: 147520! self inform: 'Hello, World!!'.! self inform: 'Hello, World!!'.! main! main! self inform: 'Hello, World!!'.! ----QUIT/NOSAVE----{10 May 2011 . 12:50:26 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{10 May 2011 . 12:50:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! self inform: 'Hello, World!!'.! | m |! main! main! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 12:58' prior: 33702246! main | m | m := Map new. self inform: 'Hello, World!!'.! ! main! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:17' prior: 33702889! main | m | m := Map new. self inform: 'Hello, World!!'.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:18' prior: 33703043! main | m | m := Map new. self inform: 'Hello, World!!'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:20' prior: 33703190! main | m | m := Map new. self inform: 'Hello, World!!'. self inform: 'sthg other'.! ! | m | m := Map new. m main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703368! main | m | m := Map new. self inform: 'done'. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 13:47' prior: 33703574! main | m | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703712! main | m form | m := Map new. m initialize. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:24' prior: 33703886! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:25' prior: 33704067! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 10@10. self inform: 'done'. ! ! | m | m := Map new. m main. ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:26' prior: 33704296! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. self inform: 'done'. ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704580! main | m form | m := Map new. m initialize. form := Form extent: 50@50 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/10/2011 14:27' prior: 33704833! main | m form | m := Map new. m initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'." ! ! | m | m := Map new. m main. ! Morph subclass: #Game instanceVariableNames: 'form' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Morph subclass: #Game instanceVariableNames: 'form map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Game methodsFor: 'nil' stamp: 'abc 5/10/2011 14:34'! main "starting point of application" | temporary variable names | ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:35' prior: 33705581! main "starting point of application" map := Map new. map initialize. form := Form extent: 50@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! Map removeSelector: #main! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:36' prior: 33705741! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "self inform: 'done'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:55' prior: 33706070! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'myGraphicsFileName') displayAt: 50@50. "self inform: 'done'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:57' prior: 33706372! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33706695! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: 'guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:58' prior: 33707040! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707387! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: '/home/michael/Desktop/guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 14:59' prior: 33707736! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. "form displayAt: 50@50." (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708146! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:00' prior: 33708495! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. "(Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 15:01' prior: 33708842! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './guy-fawkes.jpg') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:31' prior: 33709396! main "starting point of application" map := Map new. map initialize. form := Form extent: 100@100 depth: Display depth. form displayAt: 50@50. (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/10/2011 17:32' prior: 33709907! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! ----QUIT----{10 May 2011 . 9:33:43 pm} Squeak4.1.image priorSource: 147896! ----STARTUP----{11 May 2011 . 10:09:17 am} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: 'template fields m n' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! Object subclass: #Map instanceVariableNames: 'template fields x y' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:16' prior: 33701637! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711207! initMap "setting up the grid" x := 35. y := 17. "setting up template" "template = Array new: y. fields := Array new: y." fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:18' prior: 33711463! initMap "setting up the grid" x := 35. y := 17. "setting up template" template = Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'accessing' stamp: 'abc 5/11/2011 10:19' prior: 33697512! fields: anObject "Set the value of fields" fields := anObject! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33710291! main "starting point of application" "map := Map new. map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:19' prior: 33712121! main "starting point of application" map := Map new. "map initialize." "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:22' prior: 33711721! initMap "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 10:22' prior: 33712511! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33701205! initialize super initialize. self initMap. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:24' prior: 33713503! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. fields := Array new: y. fields do: [:each | each := Array new: x].! ! Map removeSelector: #initMap! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 10:38' prior: 33713797! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. fields := Array new: y. fields do: [:each | each := Array new: x].! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33713117! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." (Form fromFileNamed: './block2.png') displayAt: 50@50 asMorph. "self inform: 'done Unmatched string quote ->'."! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 11:05' prior: 33715475! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." ((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph. "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33714148! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | Transcript show: j@i. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:15' prior: 33716267! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | Transcript show: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:16' prior: 33717765! initialize super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: 2 do: [:i | 1 to: 2 do: [:j | self inform: j@i. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:17' prior: 33719222! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33720675! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:41' prior: 33722185! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33723763! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 50@50) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:42' prior: 33725345! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.png'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:44' prior: 33727030! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 11:57' prior: 33728758! initialize | pics | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:i | 1 to: x do: [:j | "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:11' prior: 33730486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | template at: j - 1 at: i = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" (i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]. "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 12:12' prior: 33732822! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1 | ((template at: j - 1) at: i) = '#') ifTrue: [blockType += 1]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:32' prior: 33735412! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType += 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType += 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:33' prior: 33738008! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType = blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType = blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:34' prior: 33740641! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:37' prior: 33743295! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((x-1)*16)@((y-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:38' prior: 33745992! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. ((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph. 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:40' prior: 33748777! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" "(i <= 1 | template at: j at: i - 1 = '#') ifTrue: [blockType += 2]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/11/2011 13:40' prior: 33715830! main "starting point of application" map := Map new. map initialize. "form := Form extent: 100@100 depth: Display depth." "form displayAt: 50@50." "((Form fromFileNamed: './block2.png') displayAt: 50@50) asMorph." "self inform: 'done Unmatched string quote ->'."! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33751644! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33754790! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:45' prior: 33757779! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" " (i >= x) ifTrue: [blockType = blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType = blockType + 2]]." "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:47' prior: 33760769! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:48' prior: 33763801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j <= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:49' prior: 33766833! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= 1) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 13:51' prior: 33769999! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 14:01' prior: 33773247! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33776454! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 15. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:33' prior: 33779649! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33782846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." blockType := 15 - blockType. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:34' prior: 33786083! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is filled" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i <= 1) ifTrue: [blockType := blockType + 2] ifFalse: [((template at: j) at: i - 1) = '#' ifTrue: [blockType := blockType + 2]]. "check if field to the right is filled" (i >= x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:44' prior: 33789318! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [blockType := blockType + 4] ifFalse: [((template at: j) at: i + 1) = '#' ifTrue: [blockType := blockType + 4]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:45' prior: 33792555! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field above is free" (j <= 1) ifTrue: [blockType := blockType + 1] ifFalse: [((template at: j - 1) at: i) = '#' ifTrue: [blockType := blockType + 1]]. "check if field to the left is filled" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is filled" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field below is filled" (j >= y) ifTrue: [blockType := blockType + 8] ifFalse: [((template at: j + 1) at: i) = '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:48' prior: 33795706! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= '#' ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= '#' ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= '#' ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= '#' ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:50' prior: 33798859! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "self inform: j@i." "blockType := 15 - blockType." ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 19:58' prior: 33801932! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank') asMorph. ]. ]. ]. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:00' prior: 33805001! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:01' prior: 33808109! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/blank.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:03' prior: 33811262! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (Form fromFileNamed: './pacman_pics/black.jpg') asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/11/2011 20:16' prior: 33814460! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! ----QUIT----{12 May 2011 . 12:42:34 am} Squeak4.1.image priorSource: 156201! ----STARTUP----{15 May 2011 . 12:07:29 pm} as /home/michael/bin/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:16' prior: 33817617! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph. ]. ]. ]. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:18' prior: 33821056! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33824352! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" "((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33827752! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 2@2) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:32' prior: 33831225! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 50@300) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:33' prior: 33834737! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 0@0) asMorph. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 12:43' prior: 33838211! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'nil' stamp: 'abc 5/15/2011 13:15'! renderPlayer: player x: x y: y "render player at a given coordinate"! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 13:22' prior: 33845368! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4.! ! Object subclass: #Map instanceVariableNames: 'template fields x y players' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:27' prior: 33841928! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ ((fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33845919! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph)). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:31' prior: 33849381! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:35' prior: 33852872! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: ((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph. "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:36' prior: 33856361! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:37' prior: 33859848! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33863337! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. ((fields at: j) at: i) put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 13:38' prior: 33866825! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:22' prior: 33870315! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33873803! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. pics at: 17 put: ''. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:26' prior: 33877292! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:31' prior: 33880801! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. fields do: [:each | each := Array new: x]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:34' prior: 33884288! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! Object subclass: #Map instanceVariableNames: 'template fields x y players points' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:37' prior: 33887775! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "draw point" ((template at: j) at: i) ~= $. ifTrue: [((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:39' prior: 33891470! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" ((Form fromFileNamed: './pacman_pics/player1.jpg') displayAt: 4@4) asMorph. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:41' prior: 33895119! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:42' prior: 33898834! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:43' prior: 33902579! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. ! ! | game | game := Game new. game main. ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:46' prior: 33845567! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player show.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:48' prior: 33910119! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player openeWorld.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:50' prior: 33910377! renderPlayer: player x: x y: y "render player at a given coordinate" player drawOn: ((x-1)*16)+4@((y-1)*16)+4. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:52' prior: 33910600! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33910804! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player display.! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:53' prior: 33911075! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((x-1)*16)+4@((y-1)*16)+4. player imageForm display.! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:54' prior: 33906285! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:55' prior: 33911565! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33915486! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 1 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 14:56' prior: 33919666! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 14:58'! redrawField: position "redraq part of the map" | temporary variable names | ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:08' prior: 33928011! redrawField: position "redraw part of the map" ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928180! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:11' prior: 33928361! redrawField: position "redraw part of the map" ((fields at: (position at: 1)) at: (position at: 2)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:12' prior: 33923846! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: (35, 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:13' prior: 33928805! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:14' prior: 33928554! redrawField: position "redraw part of the map" ((fields at: (position at: 2)) at: (position at: 1)) imageForm display. ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33932972! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. "self redrawField: #(35 1)." ! ! | game | game := Game new. game main. ! !Map methodsFor: 'initialize-release' stamp: 'abc 5/15/2011 15:15' prior: 33937391! initialize | pics blockType | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! | game | game := Game new. game main. ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:18' prior: 33937140! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). ! ! !Map methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 15:19' prior: 33945810! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: ((x-1)*16)@((y-1)*16). field imageForm display. (fields at: y) at: x put: field.! ! game := Game new.! | game | game := Game new. game main. ! Smalltalk removeClassNamed: #Wall! Smalltalk removeClassNamed: #EmptyField! Smalltalk removeClassNamed: #Field! | game | game := Game new. game main. ! !Map methodsFor: 'accessing' stamp: 'abc 5/15/2011 18:13'! template "getter for template" ^template.! ! | game | game := Game new. game main. ! !Game methodsFor: 'as yet unclassified' stamp: 'abc 5/15/2011 18:14' prior: 33754392! main "starting point of application" map := Map new. map initialize.! ! Smalltalk removeClassNamed: #Pacman! | game | game := Game new. game main. ! ----QUIT----{15 May 2011 . 6:40:23 pm} Squeak4.1.image priorSource: 266292! ----STARTUP----{16 May 2011 . 1:25:30 pm} as /home/manuel/uni/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{16 May 2011 . 1:25:47 pm} Squeak4.1.image priorSource: 392490! ----STARTUP----{16 May 2011 . 1:25:48 pm} as /home/manuel/uni/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{16 May 2011 . 1:30:07 pm} Squeak4.1.image priorSource: 392490! ----STARTUP----{24 May 2011 . 4:55:23 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 10 November 2006 at 6:07:42 pm'! Time now.! 3+4.! 3+4.! 3+4.! 3+4.! 3+4.! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 20 May 2011 at 2:14:41 pm'! ----End fileIn of a stream----! SimpleSwitchMorph subclass: #SBECell instanceVariableNames: 'mouseAction' classVariableNames: '' poolDictionaries: '' category: 'SBE-Quinto'! !SBECell methodsFor: 'nil' stamp: 'HD 5/24/2011 17:28'! initialize super initialize. self label: ''. self borderWidth: 2. bounds := 0@0 corner: 16@16. offColor := Color paleYellow. onColor := Color paleBlue darker. self useSquareCorners. self turnOff! ! SBECell new! self openInWorld! BorderedMorph subclass: #SBEGame instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SBE-Quinto'! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:36'! initialize | sampleCell width height n | super initialize. n := self cellsPerSide. sampleCell := SBECell new. width := sampleCell width. height := sampleCell height. self bounds: (5@5 extent: ((width*n) @(height *n)) + (2 * self borderWidth)). cells := Matrix new: n tabulate: [ :i :j | self newCellAt: i at: j ].! ! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:39'! cellsPerSide "The number of cells along each side of the game" ^10! ! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:39'! newCellAt: i at: j "Create a cell for position (i,j) and add it to my on--screen representation at the appropriate screen position. Answer the new cell" | c origin | c := SBECell new. origin := self innerBounds origin. self addMorph: c. c position: ((i -- 1) * c width) @ ((j -- 1) * c height) + origin. c mouseAction: [self toggleNeighboursOfCellAt: i at: j].! ! !SBEGame methodsFor: 'nil' stamp: 'HD 5/24/2011 17:40'! toggleNeighboursOfCellAt: i at: j (i > 1) ifTrue: [ (cells at: i -- 1 at: j ) toggleState]. (i < self cellsPerSide) ifTrue: [ (cells at: i + 1 at: j) toggleState]. (j > 1) ifTrue: [ (cells at: i at: j -- 1) toggleState]. (j < self cellsPerSide) ifTrue: [ (cells at: i at: j + 1) toggleState].! ! !SBECell methodsFor: 'nil' stamp: 'HD 5/24/2011 17:41'! mouseAction: aBlock ^ mouseAction := aBlock! ! !SBECell methodsFor: 'nil' stamp: 'HD 5/24/2011 17:42'! mouseUp: anEvent mouseAction value! ! !SBEGame methodsFor: 'as yet unclassified' stamp: 'HD 5/24/2011 17:43' prior: 33949038! newCellAt: i at: j "Create a cell for position (i,j) and add it to my on--screen representation at the appropriate screen position. Answer the new cell" | c origin | c := SBECell new. origin := self innerBounds origin. self addMorph: c. c position: ((i - 1) * c width) @ ((j - 1) * c height) + origin. c mouseAction: [self toggleNeighboursOfCellAt: i at: j].! ! !SBEGame methodsFor: 'as yet unclassified' stamp: 'HD 5/24/2011 17:43' prior: 33949458! toggleNeighboursOfCellAt: i at: j (i > 1) ifTrue: [ (cells at: i - 1 at: j ) toggleState]. (i < self cellsPerSide) ifTrue: [ (cells at: i + 1 at: j) toggleState]. (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState]. (j < self cellsPerSide) ifTrue: [ (cells at: i at: j + 1) toggleState].! ! SBEGame new openInWorld! !SBEGame methodsFor: 'as yet unclassified' stamp: 'HD 5/24/2011 17:48' prior: 33950039! newCellAt: i at: j "Create a cell for position (i,j) and add it to my on--screen representation at the appropriate screen position. Answer the new cell" | c origin | c := SBECell new. origin := self innerBounds origin. self addMorph: c. c position: ((i - 1) * c width) @ ((j - 1) * c height) + origin. c mouseAction: [self toggleNeighboursOfCellAt: i at: j]. ^c! ! SBEGame new openInWorld! 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 10 November 2006 at 6:07:42 pm'! ActiveHand ! Object subclass: #KeyboadMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:09'! initialize ActiveHand newKeyboardFocus: self.! ! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:10'! handlesKeyboad ^ true.! ! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:11'! keyStroke: anEvent Transcript show: anEvent keyValue.! ! !KeyboadMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:12'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus']! ! Object subclass: #KeyboardMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! Smalltalk removeClassNamed: #KeyboardMorph! a! Morph subclass: #NameOfSubclass instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! Smalltalk removeClassNamed: #NameOfSubclass! Morph subclass: #KeyboardMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! KeyboardMorph new.! KeyboardMorph new.! a! World lastKeystroke.! World lastKeystroke.! World lastKeystroke.! Smalltalk removeClassNamed: #KeyboardMorph! 'From SqueakLight of 16 August 2006 [latest update: #394] on 30 August 2008 at 7:49:37 am'! StringMorph subclass: #InfoMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:30'! initialize super initialize. showSeconds _ true. self step! ! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:39'! initializeToStandAlone super initializeToStandAlone. self step! ! !InfoMorph methodsFor: 'step' stamp: 'edc 5/12/2005 16:06'! step | time | super step. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'EDC 2/20/2002 11:30'! stepTime "Answer the desired time between steps in milliseconds." ^ 1000! ! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'EDC 6/26/2002 15:34'! cambio: s info contents:s! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! InfoMorph class instanceVariableNames: ''! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30'! authoringPrototype ^ super authoringPrototype contents: Time now printString! ! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30'! descriptionForPartsBin ^ self partName: 'Clock' categories: #('Useful') documentation: 'A digital clock'! ! !InfoMorph class methodsFor: 'as yet unclassified' stamp: 'edc 12/19/2003 13:24'! doSystemMapFrom: aClass | myMap x allClassesIneed index allClassesDict | allClassesIneed _ Set new. allClassesDict _ self storedIdentytyDict. myMap _ Arbol nuevo. myMap contenido: (SimpleButtonMorph new label: aClass asString). x _ allClassesDict storedIdentytyDict at: aClass value ifAbsent: []. index _ 1. x do: [:each | allClassesIneed add: each. myMap addNode: Arbol nuevo. (myMap at: index) contenido: (SimpleButtonMorph new label: each asString). index _ index + 1]. ^ myMap! ! ----End fileIn of a stream----! 'From SqueakLight of 16 August 2006 [latest update: #394] on 30 August 2008 at 7:49:37 am'! StringMorph subclass: #InfoMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:30' prior: 33952956! initialize super initialize. showSeconds _ true. self step! ! !InfoMorph methodsFor: 'initialization' stamp: 'EDC 2/20/2002 11:39' prior: 33953091! initializeToStandAlone super initializeToStandAlone. self step! ! !InfoMorph methodsFor: 'step' stamp: 'edc 5/12/2005 16:06' prior: 33953219! step | time | super step. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'EDC 2/20/2002 11:30' prior: 33953398! stepTime "Answer the desired time between steps in milliseconds." ^ 1000! ! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'EDC 6/26/2002 15:34' prior: 33953552! cambio: s info contents:s! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! InfoMorph class instanceVariableNames: ''! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30' prior: 33953756! authoringPrototype ^ super authoringPrototype contents: Time now printString! ! !InfoMorph class methodsFor: 'parts bin' stamp: 'EDC 2/20/2002 11:30' prior: 33953908! descriptionForPartsBin ^ self partName: 'Clock' categories: #('Useful') documentation: 'A digital clock'! ! !InfoMorph class methodsFor: 'as yet unclassified' stamp: 'edc 12/19/2003 13:24' prior: 33954104! doSystemMapFrom: aClass | myMap x allClassesIneed index allClassesDict | allClassesIneed _ Set new. allClassesDict _ self storedIdentytyDict. myMap _ Arbol nuevo. myMap contenido: (SimpleButtonMorph new label: aClass asString). x _ allClassesDict storedIdentytyDict at: aClass value ifAbsent: []. index _ 1. x do: [:each | allClassesIneed add: each. myMap addNode: Arbol nuevo. (myMap at: index) contenido: (SimpleButtonMorph new label: each asString). index _ index + 1]. ^ myMap! ! ----End fileIn of a stream----! InfoMorph new.! InfoMorph new.! | a | a := InfoMorph new. a initializeToStandAlone.! Morph subclass: #TickMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:49'! initialize super initialize. self step.! ! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:49'! wantsSteps ^ true.! ! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:49'! stepTime ^ 1000 "msecs"! ! !TickMorph methodsFor: 'nil' stamp: 'HD 5/25/2011 01:50'! step Transcript show: 'J'! ! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph new.! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 01:52' prior: 33957320! step super step. Transcript show: 'J'! ! TickMorph new.! TickMorph new.! TickMorph new.! self step! self step! self start! TickMorph new.! TickMorph new.! StringMorph subclass: #TickMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman'! TickMorph new.! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 01:55' prior: 33957235! stepTime ^ 1 "msecs"! ! TickMorph new.! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 01:56' prior: 33957054! initialize super initialize. self startStepping.! ! TickMorph new.! TickMorph new.! TickMorph new.! TickMorph! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 02:00' prior: 33958206! initialize super initialize. self step.! ! TickMorph new.! | a | a := TickMorph new. a startSteppingIn: World! | a | a := TickMorph new. a startSteppingIn: World! | a | a := TickMorph new. a startSteppingIn: World! !TickMorph methodsFor: 'as yet unclassified' stamp: 'HD 5/25/2011 02:01' prior: 33958075! stepTime ^ 10 "msecs"! ! | a | a := TickMorph new. a startSteppingIn: World! | a | a := TickMorph new. a startSteppingIn: World! ----QUIT----{25 May 2011 . 2:03:19 am} Squeak4.1.image priorSource: 392490! ----STARTUP----{25 May 2011 . 2:03:51 am} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! ----QUIT/NOSAVE----{25 May 2011 . 2:04:49 am} Squeak4.1.image priorSource: 404423! ----STARTUP----{4 June 2011 . 2:44:13 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! | i | i := InfoMorph new. i initializeToStandAlone.! | i | i := InfoMorph new. i initializeToStandAlone.! | i | i := InfoMorph new. i initialize.! | i | i := InfoMorph new.! | i | i := InfoMorph new. i show.! | i | i := InfoMorph new. i initialize.! | i | i := InfoMorph new. i initialize. Transcript show: 'Abc'.! | i | i := InfoMorph new. i initialize. Transcript show: 'Abc'.! Transcript show: 'Abc'.! Transcript show: 'Abc'.! | i | i := InfoMorph new. i initialize. Transcript show: 'Abc'.! | i | i := InfoMorph new. i position: 100 @ 200; openInWorld! Transcript show: 'abc'.! | i | i := InfoMorph new. i position: 100 @ 200; openInWorld. Transcript show: 'abc'.! ----QUIT----{4 June 2011 . 3:05:54 pm} Squeak4.1.image priorSource: 404423! ----STARTUP----{5 June 2011 . 10:57:19 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 22:59' prior: 33955265! step | time | super step. Transcript show: 'step'. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:04' prior: 33960373! step | time | super step. Transcript show: 'step'. self destroy. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:04' prior: 33960592! step | time | super step. Transcript show: 'step'. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:45'! handlesKeyboard ^ true.! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:45'! keyStroke: anEvent Transcript show: anEvent keyValue.! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:46'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus']! ! "Open a InfoMorph with timer" | i | i := InfoMorph new. ActiveHand newKeyboardFocus: i. i position: 100 @ 200; openInWorld.! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:48' prior: 33960826! step | time | super step. Transcript show: 'step'. self destroy. time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! !InfoMorph methodsFor: 'step' stamp: 'HD 6/5/2011 23:48' prior: 33961564! step | time | super step. "Transcript show: 'step'." time := Sensor peekMousePt. self contents: ChangeSet current name, ' ',time asString. ! ! "Open a InfoMorph with timer" | i | i := InfoMorph new. ActiveHand newKeyboardFocus: i. i position: 100 @ 200; openInWorld.! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/5/2011 23:51' prior: 33961112! keyStroke: anEvent Transcript show: 'bla'. Transcript show: anEvent keyValue.! ! "Open a InfoMorph with timer" | i | i := InfoMorph new. ActiveHand newKeyboardFocus: i. i position: 100 @ 200; openInWorld.! HandMorph subclass: #InputMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InputMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:53'! handlesKeyboard ^ true.! ! !InputMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:53'! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! !InputMorph methodsFor: 'nil' stamp: 'HD 6/5/2011 23:53'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus']! ! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/5/2011 23:54' prior: 33962789! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'InputGot Focus' ] ifFalse: [ Transcript show: 'InputLost Focus']! ! "Open a InfoMorph with timer" | info input | info := InfoMorph new. input := InputMorph new. ActiveHand newKeyboardFocus: input. info position: 100 @ 200; openInWorld.! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/5/2011 23:56' prior: 33962646! keyStroke: anEvent Transcript show: 'bla'. Transcript show: anEvent keyValue. "Event processing here"! ! "Open a InfoMorph with timer" | info input | info := InfoMorph new. input := InputMorph new. ActiveHand newKeyboardFocus: input. info position: 100 @ 200; openInWorld.! "Open a InfoMorph with timer" | info input | info := InfoMorph new. input := InputMorph new. ActiveHand newKeyboardFocus: input. info position: 100 @ 200; openInWorld. input position: 150 @ 200; openInWorld.! ----STARTUP----{7 June 2011 . 1:50:09 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! ActiveHand! ----QUIT----{7 June 2011 . 2:13:05 pm} Squeak4.1.image priorSource: 405615! ----STARTUP----{7 June 2011 . 6:28:09 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! Sensor ! ----QUIT----{7 June 2011 . 6:34:25 pm} Squeak4.1.image priorSource: 409666! ----STARTUP----{8 June 2011 . 1:10:50 am} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! ActiveHand! ActiveHand! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:13'! handlesKeyboard ^ true.! ! !InfoMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 01:13' prior: 33964692! handlesKeyboard Transcript show: 'ask handlesk'. ^ true.! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:14'! keyStroke: anEvent Transcript show: 'keyStroke'. Transcript show: anEvent keyValue. "Event processing here"! ! !InfoMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:14'! keyboardFocusChange: aBoolean aBoolean ifTrue: [ Transcript show: 'Got Focus' ] ifFalse: [ Transcript show: 'Lost Focus'] ! ! "Open a InfoMorph with timer" | info input | info := InfoMorph new. ActiveHand newKeyboardFocus: info. info position: 100 @ 200; openInWorld.! TextMorph subclass: #InputMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos'! !InputMorph methodsFor: 'nil' stamp: 'HD 6/8/2011 01:24'! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! | input | input := InputMorph new. ActiveHand newKeyboardFocus: input. input position: 100 @ 200; openInWorld.! ----QUIT----{8 June 2011 . 1:28:01 am} Squeak4.1.image priorSource: 409926! ----STARTUP----{8 June 2011 . 2:15:18 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! TextMorph subclass: #PacmanApp instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlA keyPlB keyPlC' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! 100 @ 200! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:26' prior: 33965567! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:27' prior: 33966398! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here"! ! 2=3! 2=3! 2=2! 2=2 ifTrue: [Transcript show: 'a']! 2=3 ifTrue: [Transcript show: 'a']! 2=3 ifTrue: [Transcript show: 'a']! | input | input := InputMorph new. ActiveHand newKeyboardFocus: input. input position: 100 @ 200; openInWorld.! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:37'! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA = #goUp:. ].! ! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:38'! stepTime "Answer the desired time between steps in milliseconds." ^ 1000! ! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:39'! step | | super step. Transcript show: keyPlA.! ! !PacmanApp methodsFor: 'nil' stamp: 'HD 6/8/2011 14:40'! initialize super initialize. self step! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:40' prior: 33967402! initialize super initialize. self step.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:40' prior: 33967535! initialize super initialize. self step. ActiveHand newKeyboardFocus: self.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:40' prior: 33967669! initialize super initialize. self step. ActiveHand newKeyboardFocus: self. self position: 100 @ 200; openInWorld.! ! | pac | pac := PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:43' prior: 33967293! step | | super step. self delete. Transcript show: keyPlA.! ! !InputMorph methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:44' prior: 33966573! keyStroke: anEvent Transcript show: anEvent keyValue. "Event processing here" Transcript show: ' '.! ! "Open a InfoMorph with timer" | info input | info := InputMorph new. ActiveHand newKeyboardFocus: info. info position: 100 @ 200; openInWorld.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:46' prior: 33968082! step | | super step. "self delete." Transcript show: keyPlA.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:46' prior: 33968582! step | | super step. "self delete." Transcript show: keyPlA.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:47' prior: 33966958! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA = #goUp:. Transcript show: 'w pressed' ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:48' prior: 33968896! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA = #goUp:. Transcript show: 'w pressed ' ] ifFalse: [ Transcript show: 'not w pressed '].! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:49' prior: 33969156! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA := #goUp:. Transcript show: 'w pressed ' ] ifFalse: [ Transcript show: 'not w pressed '].! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:50' prior: 33969484! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA := #goUp:. ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:52' prior: 33969813! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlA := #goUp:. ]. (anEvent keyValue = 97) ifTrue: [ keyPlA := #goLeft:. ]. (anEvent keyValue = 115) ifTrue: [ keyPlA := #goDown:. ]. (anEvent keyValue = 100) ifTrue: [ keyPlA := #goRight:. ]. (anEvent keyValue = 105) ifTrue: [ keyPlB := #goUp:. ]. (anEvent keyValue = 106) ifTrue: [ keyPlB := #goLeft:. ]. (anEvent keyValue = 107) ifTrue: [ keyPlB := #goDown:. ]. (anEvent keyValue = 108) ifTrue: [ keyPlB := #goRight:. ]. (anEvent keyValue = 30) ifTrue: [ keyPlC := #goUp:. ]. (anEvent keyValue = 28) ifTrue: [ keyPlC := #goLeft:. ]. (anEvent keyValue = 31) ifTrue: [ keyPlC := #goDown:. ]. (anEvent keyValue = 29) ifTrue: [ keyPlC := #goRight:. ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:53' prior: 33968739! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:53' prior: 33970960! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlC. Transcript show: '\n'.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 14:54' prior: 33971139! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlC. Transcript cr.! ! PacmanApp new.! ----SNAPSHOT----{8 June 2011 . 2:56:27 pm} Squeak4.1.image priorSource: 411333! Object subclass: #Field instanceVariableNames: 'row column' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #Wall instanceVariableNames: 'color' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Field subclass: #Wall instanceVariableNames: 'color' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Field subclass: #EmptyField instanceVariableNames: 'points' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #Pacman instanceVariableNames: 'onField' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 15:16'! initialize "setting up the grid" witdh := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:16' prior: 33972547! initialize "setting up the grid" witdh := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:18' prior: 33973801! initialize "setting up the grid" width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)].! ! Object subclass: #FieldMap instanceVariableNames: 'height template fields width' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: 'width height template fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: 'width height fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:19' prior: 33975059! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:20' prior: 33976884! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:22' prior: 33978271! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:22' prior: 33979926! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:22' prior: 33981503! initialize "setting up the grid" | template | width := 35. height := 17. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 15:23'! dump ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:23' prior: 33984703! dump 1 to: height do: [:j | 1 to: width do: [:i | (fields at: j) at: i put: EmptyField new. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:24' prior: 33984801! dump 1 to: height do: [:j | 1 to: width do: [:i | (fields at: j) at: i getChar. ]. ].! ! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 15:25'! getChar ^' '.! ! !Field methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:25' prior: 33985159! getChar ^ ' '.! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 15:26'! getChar ^ (points) printString.! ! !Wall methodsFor: 'nil' stamp: 'HD 6/8/2011 15:26'! getChar ^ '+'.! ! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlA keyPlB keyPlC fieldMap' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:27' prior: 33967839! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 100 @ 200; openInWorld.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:27' prior: 33971435! step | | super step. "self delete." Transcript show: keyPlA. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlC. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:28' prior: 33985004! dump 1 to: height do: [:j | 1 to: width do: [:i | Transcript show: ((fields at: j) at: i getChar). ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:29' prior: 33986224! dump 1 to: height do: [:j | 1 to: width do: [:i | Transcript show: (((fields at: j) at: i) getChar). ]. ].! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:30' prior: 33967157! stepTime "Answer the desired time between steps in milliseconds." ^ 10000! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:31' prior: 33986433! dump 1 to: height do: [:j | 1 to: width do: [:i | Transcript show: (((fields at: j) at: i) getChar). ]. Transcript cr. ].! ! ----SNAPSHOT----{8 June 2011 . 3:31:26 pm} Squeak4.1.image priorSource: 417201! PacmanApp new.! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 15:33'! initialize points := 1.! ! PacmanApp new.! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:36' prior: 33983122! initialize "setting up the grid" | template | width := 35. height := 3. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:38' prior: 33987291! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: height. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:38' prior: 33988903! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! PacmanApp new.! PacmanApp new.! ----QUIT----{8 June 2011 . 3:40:07 pm} Squeak4.1.image priorSource: 432535! ----STARTUP----{8 June 2011 . 3:42:58 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:43' prior: 33985694! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 10 @ 10; openInWorld.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 15:43' prior: 33992408! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld.! ! PacmanApp new.! Object subclass: #Pacman instanceVariableNames: 'onRow onCol' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #Pacman instanceVariableNames: 'onRow onCol color' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! ----QUIT----{8 June 2011 . 3:47:07 pm} Squeak4.1.image priorSource: 437636! ----STARTUP----{8 June 2011 . 6:38:17 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:39'! onRow: row onRow := row.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:39'! onCol: col onCol := col.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:40'! color: c color := c.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:41' prior: 33993579! color: c " R(ed), B(lue), G(reen)" color := c.! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:42' prior: 33985936! step | | super step. "self delete." Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:42' prior: 33970045! keyStroke: anEvent "Stores the direction to go in next step for every player." (anEvent keyValue = 119) ifTrue: [ keyPlR := #goUp:. ]. (anEvent keyValue = 97) ifTrue: [ keyPlR := #goLeft:. ]. (anEvent keyValue = 115) ifTrue: [ keyPlR := #goDown:. ]. (anEvent keyValue = 100) ifTrue: [ keyPlR := #goRight:. ]. (anEvent keyValue = 105) ifTrue: [ keyPlB := #goUp:. ]. (anEvent keyValue = 106) ifTrue: [ keyPlB := #goLeft:. ]. (anEvent keyValue = 107) ifTrue: [ keyPlB := #goDown:. ]. (anEvent keyValue = 108) ifTrue: [ keyPlB := #goRight:. ]. (anEvent keyValue = 30) ifTrue: [ keyPlG := #goUp:. ]. (anEvent keyValue = 28) ifTrue: [ keyPlG := #goLeft:. ]. (anEvent keyValue = 31) ifTrue: [ keyPlG := #goDown:. ]. (anEvent keyValue = 29) ifTrue: [ keyPlG := #goRight:. ].! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:45' prior: 33990515! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: EmptyField new. ] ifFalse: [ (fields at: j) at: i put: Wall new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:45' prior: 33995495! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:45' prior: 33997171! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB = Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'R'. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:46' prior: 33998983! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB = Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'R'. plG = Pacman new. plG onRow: 1. plG onCol: 30. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:46' prior: 34000796! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR = Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB = Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG = Pacman new. plG onRow: 1. plG onCol: 30. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:47' prior: 33986830! dump 1 to: height do: [:j | 1 to: width do: [:i | plR Transcript show: (((fields at: j) at: i) getChar). ]. Transcript cr. ].! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:47'! onRow ^ onRow.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:47'! onCol ^ onCol.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 18:47'! color ^ color.! ! 1=1! 1=1 and: [2= 2]! 1=1 and: [2= 3] ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:51' prior: 34004424! dump 1 to: height do: [:j | 1 to: width do: [:i | (plR onRow = j and: [plR onCol = i]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ Transcript show: (((fields at: j) at: i) getChar). ] ]. Transcript cr. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:52' prior: 34004920! dump 1 to: height do: [:j | 1 to: width do: [:i | (plR onRow = j and: [plR onCol = i]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ (plB onRow = j and: [plB onCol = i]) ifTrue: [ Transcript show: plB color. ] ifFalse: [ (plG onRow = j and: [plG onCol = i]) ifTrue: [ Transcript show: plG color. ] ifFalse: [ Transcript show: (((fields at: j) at: i) getChar). ] ] ] ]. Transcript cr. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 18:54' prior: 34002610! initialize "setting up the grid" | template | width := 35. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 30. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! PacmanApp new.! ----SNAPSHOT----{8 June 2011 . 6:54:57 pm} Squeak4.1.image priorSource: 438676! ----QUIT----{8 June 2011 . 6:55:19 pm} Squeak4.1.image priorSource: 453137! ----STARTUP----{8 June 2011 . 7:01:47 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 19:03'! canBeVisited ^ false.! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 19:04'! canBeVisited ^ true.! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points ^ points.! ! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points ^ 0.! ! !Field methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points: pt! ! !Field methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:05' prior: 34008264! points: pt ! ! !Field methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:05' prior: 34008363! points: pt! ! !EmptyField methodsFor: 'nil' stamp: 'HD 6/8/2011 19:05'! points: pt points := pt.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:07' prior: 33994135! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:08' prior: 34008654! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:09'! calcMovement: wantedMove of: player! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:10' prior: 34009167! calcMovement: wantedMove of: player ! ! FieldMap removeSelector: #calcMovement:of:! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:14'! calcMove: move on: field! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:15' prior: 34009434! calcMove: move on: field ! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:15'! fields ^ fields.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:16' prior: 34009548! calcMove: move on: field ! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:17' prior: 34009741! calcMove: move on: field self perform: move with: field! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:18'! calcMoveOn: field row: row col: col ! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:18' prior: 34009971! calcMoveOn: field row: row col: col ((field fields at: row) at: col) ! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:20' prior: 34010098! calcMoveOn: field row: row col: col ((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ]! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:20' prior: 34010258! calcMoveOn: field row: row col: col ((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:23'! goUp: field Transcript show: 'a'. self calcMoveOn: field row: onRow col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:23' prior: 34010815! goUp: field self calcMoveOn: field row: onRow col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:24' prior: 34010987! goUp: field self calcMoveOn: field row: onRow+1 col: onCol.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:24'! goDown: field self calcMoveOn: field row: onRow-1 col: onCol.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:24'! goLeft: field self calcMoveOn: field row: onRow col: onCol-1.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/8/2011 19:24'! goRight: field self calcMoveOn: field row: onRow col: onCol-1.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:24' prior: 34011497! goRight: field self calcMoveOn: field row: onRow col: onCol+1.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:26'! movePlR: move plR mov! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:26' prior: 34011775! movePlR: move plR calcMove: move on: self.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:26'! movePlB: move plB calcMove: move on: self.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:26'! movePlG: move plG calcMove: move on: self.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:27' prior: 34008927! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap dump.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:28' prior: 34009857! calcMove: move on: field (move = nil) ifFalse: [self perform: move with: field.] .! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:29'! initialize score := 0.! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:31' prior: 34011255! goDown: field self calcMoveOn: field row: onRow+1 col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:31' prior: 34011136! goUp: field self calcMoveOn: field row: onRow-1 col: onCol.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:31' prior: 34013043! goUp: field self calcMoveOn: field row: onRow-1 col: onCol.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:32'! width ^ width.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/8/2011 19:32'! height ^ height.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:34' prior: 34010530! calcMoveOn: field row: row col: col ( col >= 0 and: [field height >= col and: [row >= 0 and: [field width >= row and: [((field fields at: row) at: col) canBeVisited]]]] ) ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:35' prior: 34013496! calcMoveOn: field row: row col: col ( col >= 1 and: [field height+1 >= col and: [row >= 1 and: [field width+1 >= row and: [((field fields at: row) at: col) canBeVisited]]]] ) ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:37' prior: 34013902! calcMoveOn: field row: row col: col ( col >= 1 and: [field width+1 >= col and: [row >= 1 and: [field height+1 >= row and: [((field fields at: row) at: col) canBeVisited]]]] ) ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ]! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:38' prior: 33986662! stepTime "Answer the desired time between steps in milliseconds." ^ 4000! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:39' prior: 34014329! calcMoveOn: field row: row col: col ( col >= 1 and: [field width+1 >= col and: [row >= 1 and: [field height+1 >= row]]] ) ifTrue: [((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ] ]! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/8/2011 19:41' prior: 34014924! calcMoveOn: field row: row col: col ( col >= 1 and: [field width >= col and: [row >= 1 and: [field height >= row]]] ) ifTrue: [((field fields at: row) at: col) canBeVisited ifTrue: [ onRow := row. onCol := col. score := score + ((field fields at: row) at: col) points. ((field fields at: row) at: col) points: 0. ] ]! ! PacmanApp new.! ----SNAPSHOT----{8 June 2011 . 7:42:52 pm} Squeak4.1.image priorSource: 453218! ----QUIT----{8 June 2011 . 7:48:43 pm} Squeak4.1.image priorSource: 461273! ----STARTUP----{9 June 2011 . 12:19:45 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:29' prior: 34012231! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap dump.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 12:29'! rememberOldPlPos ! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol ' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:30' prior: 34016478! rememberOldPlPos oldPlRrow := plR ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:31' prior: 34016806! rememberOldPlPos oldPlRrow := plR onRow. oldPlRcol := plR onCol. oldPlBrow := plB onRow. oldPlBcol := plB onCol. oldPlGrow := plG onRow. oldPlGcol := plG onCol.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 12:32'! calcCatched ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:36' prior: 34017159! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ ^ true ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:36' prior: 34017264! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ ^ true ]. ^ false.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/9/2011 12:37'! score ^ score.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/9/2011 12:37'! score: s score := s.! ! ----QUIT----{9 June 2011 . 12:37:41 pm} Squeak4.1.image priorSource: 461354! ----STARTUP----{9 June 2011 . 12:56:57 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 12:59' prior: 34017570! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 13:01' prior: 34018294! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 13:02' prior: 34016127! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 13:03' prior: 34019541! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 13:03'! plR ^plR.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 13:03'! plB ^ plB.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 13:03'! plG ^ plG.! ! ----QUIT----{9 June 2011 . 1:03:48 pm} Squeak4.1.image priorSource: 463521! ----STARTUP----{9 June 2011 . 2:05:21 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:06' prior: 34019948! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:09' prior: 33992665! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. fieldMap draw.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 14:10'! draw! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:14' prior: 34020959! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:15' prior: 34021786! draw "TODO draw all tiles"! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 14:15'! drawUpdates ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:15' prior: 34022577! drawUpdates "Update tiles that changed"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:16' prior: 34022682! drawUpdates "Update tiles that changed" ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:16' prior: 34022814! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 14:18'! drawTileRow: row Col: col "TODO redraw tile specified by row and col"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:18' prior: 34022948! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol. self drawTileRow: plR onRow Col: plR onCol.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 14:19' prior: 34023255! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol. self drawTileRow: plR onRow Col: plR onCol. self drawTileRow: oldPlBrow Col: oldPlBcol. self drawTileRow: plB onRow Col: plB onCol. self drawTileRow: oldPlGrow Col: oldPlGcol. self drawTileRow: plG onRow Col: plG onCol.! ! ----QUIT----{9 June 2011 . 2:23:06 pm} Squeak4.1.image priorSource: 466187! ----STARTUP----{9 June 2011 . 9:49:29 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:50' prior: 34022490! draw "TODO initialize and draw all tiles"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:51' prior: 34005824! initialize "setting up the grid" | template | width := 14. height := 4. "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:52' prior: 34024263! initialize "setting up the grid" | template | width := 14. "35" height := 4. "17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:52' prior: 34026080! initialize "setting up the grid" | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !Wall methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 21:53' prior: 33985427! getChar (color = 'R') ifTrue: [^ 'r']. (color = 'B') ifTrue: [^ 'b']. (color = 'G') ifTrue: [^ 'g']. ^ '+'.! ! PacmanApp new.! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 10 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! 1 atRandom! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:12'! randomRow ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:12' prior: 34030259! randomRow ^ height atRandom.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:13'! randomCol ^ width atRandom.! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:13'! processColoredWall! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:14' prior: 34021883! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap calcCatched. fieldMap processColoredWall. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:16' prior: 34030768! processColoredWall | x y | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. ]! ! !Field methodsFor: 'nil' stamp: 'HD 6/9/2011 22:17'! isWall ^ false.! ! !Wall methodsFor: 'nil' stamp: 'HD 6/9/2011 22:17'! isWall ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:20' prior: 34031520! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:21' prior: 34031868! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ]! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/9/2011 22:21'! randomColor | c | c := 3 atRandom.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:22' prior: 34032426! randomColor | c | c := 3 atRandom. (c=1) ifTrue: [ ^ 'R' ]. (c=2) ifTrue: [ ^ 'B' ]. ^ 'G'.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:27' prior: 34032112! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ ]! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/9/2011 22:28'! isOnRow: row Col: col (onRow = row and: [ onCol = col]) ifTrue: [ ^ true. ] ifFalse: [ ^ false. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:31' prior: 34032746! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall := nil. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:31' prior: 34033274! processColoredWall | x y field | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ]! ! PacmanApp new.! !Wall methodsFor: 'nil' stamp: 'HD 6/9/2011 22:32'! color ^ color.! ! !Wall methodsFor: 'nil' stamp: 'HD 6/9/2011 22:32'! color: c color := c.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:36' prior: 34033773! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ rand := 3. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/9/2011 22:37' prior: 34034483! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! ----QUIT----{9 June 2011 . 10:37:18 pm} Squeak4.1.image priorSource: 469358! ----STARTUP----{10 June 2011 . 2:54:40 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:56' prior: 34030879! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:56' prior: 34035928! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:57' prior: 34018662! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! Object subclass: #Field instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 14:59' prior: 34035074! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:00' prior: 34038481! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. coloredWallRow := nil. coloredWallCol := nil. ] ] ]! ! true.! true.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:04' prior: 34037215! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color = coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:04' prior: 34039865! calcCatched ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:06' prior: 34040840! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:06' prior: 34041817! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:06' prior: 34042934! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]). ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:07' prior: 34044114! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:08' prior: 34045292! calcCatched | plWallColor | (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:08' prior: 34039134! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 4) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. coloredWallRow := nil. coloredWallCol := nil. ] ] ]! ! PacmanApp new.! !Wall methodsFor: 'nil' stamp: 'HD 6/10/2011 15:10'! canBeVisited (color = nil) ifTrue: [ ^ false. ] ifFalse: [ ^ true. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:12' prior: 34046561! calcCatched | plWallColor | (coloredWall !!= nil) ifTrue: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:13' prior: 34049069! calcCatched | plWallColor | (coloredWall = nil) ifTrue: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:13' prior: 34050768! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ plB color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:15' prior: 34052465! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ plR color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! true not ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:15' prior: 34054180! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color !!= coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ plG color !!= coloredWall color ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:15' prior: 34055894! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! PacmanApp new.! PacmanApp new.! PacmanApp new.! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'nil' stamp: 'HD 6/10/2011 15:24'! startNewGame! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:24' prior: 34059365! startNewGame | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ].! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:25' prior: 34059470! startNewGame | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34027908! initialize "setting up the grid" plR := Pacman new. plR onRow: 1. plR onCol: 1. plR color: 'R'. plB := Pacman new. plB onRow: 1. plB onCol: 10. plB color: 'B'. plG := Pacman new. plG onRow: 1. plG onCol: 12. plG color: 'G'.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34061296! startNewGame | template | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34062892! initialize "setting up the grid" plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:26' prior: 34064941! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'.! ! !FieldMap methodsFor: 'nil' stamp: 'HD 6/10/2011 15:28'! getEmptyField true whileTrue: [ ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:28' prior: 34065371! getEmptyField | row col | true whileTrue: [ row := height atRandom. col := width atRandom. ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:30' prior: 34065506! getEmptyField | row col | true whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ row@col. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:31' prior: 34063227! startNewGame | template f | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:31' prior: 34065980! startNewGame | template f | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:32' prior: 34065184! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. self startNewGame.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:32' prior: 34069468! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. self startNewRound.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:32'! startNewRound | template f | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! FieldMap removeSelector: #startNewGame! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:34' prior: 34065707! getEmptyField | row col | [ true ] whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ row@col. ] ]! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:35' prior: 34048208! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. coloredWallRow := nil. coloredWallCol := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:36' prior: 34069935! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := f. h := f. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:37' prior: 34072730! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := f. h := f. [ f = g ] whileTrue: [ g = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:37' prior: 34074501! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := f. h := f. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ f = g ] whileTrue: [ g = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:38' prior: 34076325! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: 1. plB onCol: 10. plG onRow: 1. plG onCol: 12.! ! ----SNAPSHOT----{10 June 2011 . 3:38:29 pm} Squeak4.1.image priorSource: 481153! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:39' prior: 34078198! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: g x. plB onCol: g y. plG onRow: 1. plG onCol: 12.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:39' prior: 34071723! getEmptyField | row col | [ true ] whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ col@row. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:39' prior: 34080236! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f x. plR onCol: f y. plB onRow: g x. plB onCol: g y. plG onRow: h x. plG onCol: h y.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:40' prior: 34082438! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! PacmanApp new.! Object subclass: #Pacman instanceVariableNames: 'onRow onCol color score totalScore' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:42' prior: 34036571! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:42' prior: 34086487! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. fieldMap calcCatched. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 15:42'! totalScore ^ totalScore.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:43' prior: 34087366! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 15:44'! totalScore: ts totalScore := ts.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:45' prior: 34088344! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:50' prior: 34057602! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue'; cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue'; cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green'; cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green'; cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red'; cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red'; cr. ^ true ]. ^ false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:50' prior: 34089352! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. fieldMap startNewRound. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:51' prior: 34092469! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. fieldMap startNewRound. ]. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap drawUpdates. fieldMap dump.! ! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:52' prior: 34012760! initialize score := 0. totalScore := 0.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:55' prior: 34093651! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore. fieldMap plR totalScore: 0. fieldMap plB totalScore: fieldMap plB totalScore. fieldMap plB totalScore: 0. fieldMap plG totalScore: fieldMap plG totalScore. fieldMap plG totalScore: 0. keyPlR := nil. keyPlB := nil. keyPlG := nil. fieldMap startNewRound. ]. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap drawUpdates. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:55' prior: 34094999! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlR := nil. keyPlB := nil. keyPlG := nil. fieldMap startNewRound. ]. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap drawUpdates. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 15:56' prior: 34024129! draw "TODO initialize and draw all tiles" nil err.! ! ----STARTUP----{10 June 2011 . 4:05:11 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:05' prior: 34078198! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:05' prior: 34071723! getEmptyField | row col | [ true ] whileTrue: [ row := height atRandom. col := width atRandom. (((fields at: row) at: col) isWall) ifFalse: [ ^ col@row. ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:06' prior: 34057602! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:06' prior: 34100042! calcCatched | plWallColor | (coloredWall = nil) ifFalse: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:07' prior: 34036571! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! Object subclass: #Pacman instanceVariableNames: 'onRow onCol color score totalScore' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 16:07'! totalScore: ts ^ totalScore := ts.! ! !Pacman methodsFor: 'nil' stamp: 'HD 6/10/2011 16:08'! totalScore ^ totalScore.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:08' prior: 34104551! totalScore: ts totalScore := ts.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:09' prior: 34103749! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:09' prior: 34104888! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap startNewRound. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:09' prior: 34105666! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:10' prior: 34106471! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! ----SNAPSHOT----{10 June 2011 . 4:10:23 pm} Squeak4.1.image priorSource: 543141! PacmanApp new.! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:11' prior: 34012760! initialize score := 0. totalScore := 0.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:12' prior: 34107506! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:12' prior: 34108790! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! PacmanApp new.! ----STARTUP----{10 June 2011 . 4:24:52 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:25' prior: 34107506! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. fieldMap dump.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:25' prior: 34111365! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !Pacman methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:25' prior: 34012760! initialize score := 0. totalScore := 0.! ! ----SNAPSHOT----{10 June 2011 . 4:26:11 pm} Squeak4.1.image priorSource: 556668! PacmanApp new.! ----STARTUP----{10 June 2011 . 4:30:35 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:31' prior: 34112652! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ "fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil." fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! PacmanApp new.! ----STARTUP----{10 June 2011 . 4:32:52 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:33' prior: 34101792! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:34' prior: 34115853! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:34' prior: 34117800! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue';cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green';cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red';cr. ^ true ]. ^ false.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:35' prior: 34119750! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue.' ; cr. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ^ false.! ! ----SNAPSHOT----{10 June 2011 . 4:35:37 pm} Squeak4.1.image priorSource: 559563! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:36' prior: 34112652! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ "fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:36' prior: 34023093! drawTileRow: row Col: col "TODO redraw tile specified by row and col"! ! ----SNAPSHOT----{10 June 2011 . 4:37:06 pm} Squeak4.1.image priorSource: 569145! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:37' prior: 34123750! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound. fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! ----SNAPSHOT----{10 June 2011 . 4:38:03 pm} Squeak4.1.image priorSource: 570694! ----STARTUP----{10 June 2011 . 4:40:44 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:40' prior: 34125316! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ "fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! ----STARTUP----{10 June 2011 . 4:42:06 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:43' prior: 34097837! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. "f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]." plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 3. plG onRow: 1. plG onCol: 5.! ! ----SNAPSHOT----{10 June 2011 . 4:43:19 pm} Squeak4.1.image priorSource: 572097! PacmanApp new.! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:44' prior: 34125316! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. fieldMap dump.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:46:27 pm} Squeak4.1.image priorSource: 575749! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:48' prior: 34128353! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: 1. plR onCol: 1. plB onRow: 1. plB onCol: 3. plG onRow: 1. plG onCol: 5.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:49:59 pm} Squeak4.1.image priorSource: 577184! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:50' prior: 34131788! startNewRound | template f g h | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:51:36 pm} Squeak4.1.image priorSource: 579199! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:53' prior: 34133803! startNewRound | template f g h rand | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. rand := 10 atRandom. (rand = 1) ifTrue: [ ]. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 16:54' prior: 34135830! startNewRound | template f g h rand | width := 14. "original 35" height := 4. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. rand := 10 atRandom. (rand = 1) ifTrue: [ ((fields at: j) at: i) points: 5. ]. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! ----SNAPSHOT----{10 June 2011 . 4:54:31 pm} Squeak4.1.image priorSource: 581226! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 4:55:26 pm} Squeak4.1.image priorSource: 585346! ----QUIT----{10 June 2011 . 4:55:31 pm} Squeak4.1.image priorSource: 585445! ----STARTUP----{10 June 2011 . 5:02:44 pm} as D:\UserData\harald\Documents\git\foop_new\foop\pacman-smalltalk\Squeak 4.1 All-in-One.app\Contents\Resources\Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:04' prior: 34072017! processColoredWall | x y field rand | (coloredWall = nil) ifTrue: [ x := self randomCol. y := self randomRow. field := (fields at: y) at: x. (field isWall) ifTrue: [ field color: self randomColor. coloredWall := field. coloredWallRow := y. coloredWallCol := x. ] ] ifFalse: [ rand := 3 atRandom. (rand = 1) ifTrue: [ ((plR isOnRow: y Col: x) or: [ (plB isOnRow: y Col: x) or: [ plG isOnRow: y Col: x] ]) ifFalse: [ coloredWall color: nil. coloredWall := nil. ] ] ]! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:04' prior: 34023477! drawUpdates "Update tiles that changed" self drawTileRow: oldPlRrow Col: oldPlRcol. self drawTileRow: plR onRow Col: plR onCol. self drawTileRow: oldPlBrow Col: oldPlBcol. self drawTileRow: plB onRow Col: plB onCol. self drawTileRow: oldPlGrow Col: oldPlGcol. self drawTileRow: plG onRow Col: plG onCol. self drawTileRow: coloredWallRow Col: coloredWallCol.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34125053! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ true ]. "TODO redraw tile specified by row and col"! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34141412! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ true ]. "TODO redraw tile specified by row and col" ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34141624! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'HD 6/10/2011 17:05' prior: 34141845! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" ^ true.! ! PacmanApp new.! ----SNAPSHOT----{10 June 2011 . 5:06:24 pm} Squeak4.1.image priorSource: 585527! ----QUIT----{10 June 2011 . 5:07:06 pm} Squeak4.1.image priorSource: 587788! ----STARTUP----{23 June 2011 . 8:41:35 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! ----QUIT/NOSAVE----{23 June 2011 . 8:46:03 pm} Squeak4.1.image priorSource: 587870! ----STARTUP----{24 June 2011 . 10:21 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 10:47' prior: 34024129! draw map := Map new. map initialize.! ! PacmanApp new.! PacmanApp new.! ----QUIT/NOSAVE----{24 June 2011 . 10:51:31 am} Squeak4.1.image priorSource: 587870! ----STARTUP----{24 June 2011 . 10:51:34 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 10:52' prior: 34024129! draw "TODO initialize and draw all tiles" map := Map new. map initialize.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 10:53' prior: 34143834! draw "TODO initialize and draw all tiles" "map := Map new. map initialize."! ! PacmanApp new.! ----STARTUP----{24 June 2011 . 10:58:52 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! PacmanApp new.! PacmanApp new.! ----STARTUP----{24 June 2011 . 11:29:13 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! ----STARTUP----{24 June 2011 . 12:42:40 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 12:42' prior: 34142067! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" ^ true.! ! PacmanApp new.! ----QUIT----{24 June 2011 . 12:43:05 pm} Squeak4.1.image priorSource: 587870! ----STARTUP----{24 June 2011 . 12:43:07 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! ----QUIT/NOSAVE----{24 June 2011 . 12:47:47 pm} Squeak4.1.image priorSource: 590477! ----STARTUP----{24 June 2011 . 8:13:58 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Map new.! PacmanApp new.! ----STARTUP----{24 June 2011 . 8:30:58 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 20:40' prior: 33941601! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extend: 330@240 depth: 1. form fillColor: Color Black. ! ! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 20:40' prior: 34021561! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. fieldMap draw. map := Map new. map initialize.! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 20:43' prior: 34145673! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extent: 300@300 depth: Display depth. form fillColor: Color Black. ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:04' prior: 34150371! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:05' prior: 34154627! initialize | pics blockType form | super initialize. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400. ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:15' prior: 34158900! initialize | pics blockType form offsetX offsetY| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: offsetX + ((i-1)*16)@offsetY + ((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! PacmanApp new.! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:17' prior: 34163201! initialize | pics blockType offsetX offsetY| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:19' prior: 34167587! initialize | pics blockType offsetX offsetY| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! Object subclass: #Map instanceVariableNames: 'template fields x y players points offsetX offsetY' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 21:19' prior: 34171955! initialize | pics blockType| super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). " form := Form extent: 300@300 depth: Display depth. form fillColor: Color black. form displayAt: 400@400." ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:19' prior: 33946078! redrawField: position "redraw part of the map" | field x y| x := position at: 1. y := position at: 2. field := (fields at: y) at: x. field position: (offsetX + ((x-1)*16))@(offsetY + ((y-1)*16)). field imageForm display. (fields at: y) at: x put: field.! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:23' prior: 33911295! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:42' prior: 34150083! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. fieldMap draw. ! ! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:43' prior: 34024129! draw "TODO initialize and draw all tiles" map := Map new. map initialize.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:44' prior: 34144748! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawField: #(col row). ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:44' prior: 34182080! draw "TODO initialize and draw all tiles" map initialize.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:45' prior: 34069709! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. map := Map new. self startNewRound.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:46' prior: 34182266! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawField: #(2 2). ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:48' prior: 34182941! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '#####'. Transcript show: row. Transcript show: col. map redrawField: #(2 2). ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:49' prior: 34183216! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawField: #(col row). ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:52' prior: 34183564! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: (Integer isInteger row). "map redrawField: #(col row)." ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:52' prior: 34183828! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (Integer isInteger row). "map redrawField: #(col row)." ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:53' prior: 34184135! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (row isInteger). "map redrawField: #(col row)." ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:54' prior: 34184468! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (row isInteger). Transcript show: (col isInteger). "map redrawField: #(col row)." ^ true.! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:56'! redrawFieldX: x y: y "redraw part of the map" | field | field := (fields at: y) at: x. field position: (offsetX + ((x-1)*16))@(offsetY + ((y-1)*16)). field imageForm display. (fields at: y) at: x put: field.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 21:57' prior: 34184810! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" Transcript show: '####'. Transcript show: (row isInteger). Transcript show: (col isInteger). map redrawFieldX: col y: row. ^ true.! ! ----STARTUP----{24 June 2011 . 10:00:06 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #Map instanceVariableNames: 'template fields x y players points offsetX offsetY' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Model'! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 22:02' prior: 33941601! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: ((i-1)*16)@((j-1)*16)) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: ((i-1)*16)@((j-1)*16)) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (((i-1)*16)+4)@(((j-1)*16)+4)) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 22:04' prior: 34186161! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. self redrawField: #(35 1). ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/24/2011 22:04' prior: 34190361! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: (players at: 1) x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: (players at: 2) x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: (players at: 3) x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: (players at: 4) x: 35 y: 17. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:05' prior: 33911295! renderPlayer: player x: x y: y "render player at a given coordinate" player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:05'! redrawFieldX: x y: y "redraw part of the map" | field | field := (fields at: y) at: x. field position: (offsetX + ((x-1)*16))@(offsetY + ((y-1)*16)). field imageForm display. (fields at: y) at: x put: field.! ! ----QUIT----{24 June 2011 . 10:06:58 pm} Squeak4.1.image priorSource: 590477! ----STARTUP----{24 June 2011 . 10:07:01 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:08' prior: 34069709! initialize plR := Pacman new. plR color: 'R'. plB := Pacman new. plB color: 'B'. plG := Pacman new. plG color: 'G'. map := Map new. self startNewRound.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:08' prior: 34024129! draw "TODO initialize and draw all tiles" map initialize.! ! PacmanApp new.! ----QUIT----{24 June 2011 . 10:09:02 pm} Squeak4.1.image priorSource: 644905! ----STARTUP----{24 June 2011 . 10:09:05 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/24/2011 22:09' prior: 34144748! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. ^ true.! ! PacmanApp new.! ----QUIT----{24 June 2011 . 10:10:32 pm} Squeak4.1.image priorSource: 645840! ----STARTUP----{25 June 2011 . 10:57:48 am} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:09' prior: 34200604! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [ Transcript show: plB color. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ Transcript show: plG color. ] ] ]. ^ true.! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:14' prior: 34198880! renderPlayer: playerId x: x y: y "render player at a given coordinate" | player | player := players at: 1. player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/25/2011 11:16' prior: 34194633! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). self renderPlayer: 1 x: 1 y: 1. players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). self renderPlayer: 2 x: 5 y: 17. players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). self renderPlayer: 3 x: 35 y: 1. players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). self renderPlayer: 4 x: 35 y: 17. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:16' prior: 34201719! renderPlayer: playerId x: x y: y "render player at a given coordinate" | player | player := players at: playerId. player position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). player imageForm display.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 11:20' prior: 34201143! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. ^ true.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:28' prior: 34206550! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. "(((fields at: row) at: col) isWall)" ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:34' prior: 34207168! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [Transcript show: 'refresh wall'.]. "(color = 'R') ifTrue: [^ 'r']. (color = 'B') ifTrue: [^ 'b']. (color = 'G') ifTrue: [^ 'g']. ^ '+'." ^ true.! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:34' prior: 34207810! drawTileRow: row Col: col row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [Transcript show: 'refresh wall'.]. "(color = 'R') ifTrue: [^ 'r']. (color = 'B') ifTrue: [^ 'b']. (color = 'G') ifTrue: [^ 'g']. ^ '+'." ^ true. ! ! PacmanApp new.! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:48' prior: 34208607! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := 'r'. (color = 'r') ifTrue: [^ 'r']. (color = 'b') ifTrue: [^ 'b']. (color = 'g') ifTrue: [^ 'g']. (color = '+') ifTrue: [^ '+']. ]. ^ true. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:51' prior: 34209439! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) color. (color = 'r') Transcript show: 'r'. (color = 'b') Transcript show: 'b'. (color = 'g') Transcript show: 'g'. (color = '+') Transcript show: '+'. ]. ^ true. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:51' prior: 34210266! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) color. (color = 'r') Transcript show: 'red'. (color = 'b') Transcript show: 'blue'. (color = 'g') Transcript show: 'yellow'. (color = '+') Transcript show: '+'. ]. ^ true. ! ! PacmanApp new.! ----QUIT----{25 June 2011 . 1:52:50 pm} Squeak4.1.image priorSource: 646362! ----STARTUP----{25 June 2011 . 1:52:53 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:54' prior: 34211142! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) color. (color = 'r') ifTrue: [Transcript show: 'red'.]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ]. ^ true. ! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:56' prior: 34212302! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. (color = 'r') ifTrue: [Transcript show: 'red'.]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ]. ^ true. ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/25/2011 13:57' prior: 34202032! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! !Map methodsFor: 'nil' stamp: 'mr 6/25/2011 13:58'! colorWallX: x y: y "comment stating purpose of message" | | ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 13:59'! wallColor: color x: x y: y "comment stating purpose of message" | | ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:00' prior: 34213249! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:00' prior: 34218495! wallColor: color x: x y: y "comment stating purpose of message" (color = 'r') ifTrue: [Transcript show: 'red'.]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:02' prior: 34219406! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/redjpg') asMorph. ]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:03' prior: 34219777! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/redjpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:04' prior: 34220211! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [Transcript show: 'blue'.]. (color = 'g') ifTrue: [Transcript show: 'yellow'.]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:07' prior: 34220759! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/yellow.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [Transcript show: '+'.]. ! ! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:08' prior: 34221308! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/yellow.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') self redrawFieldX: x y: y. ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:12' prior: 34222142! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/yellow.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:20' prior: 34137832! startNewRound | template f g h rand | width := 35. "original 35" height := 17. "orginial 17" "setting up template" template := Array new: 17. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields array" fields := Array new: height. 1 to: height do: [:i | fields at: i put: (Array new: width)]. 1 to: height do: [:j | 1 to: width do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: Wall new. ] ifFalse: [ (fields at: j) at: i put: EmptyField new. rand := 10 atRandom. (rand = 1) ifTrue: [ ((fields at: j) at: i) points: 5. ]. ]. ]. ]. f := self getEmptyField. g := self getEmptyField. h := self getEmptyField. [ f = g ] whileTrue: [ g = self getEmptyField. ]. [ (h = g) or: [ h = f] ] whileTrue: [ h = self getEmptyField. ]. plR onRow: f y. plR onCol: f x. plB onRow: g y. plB onCol: g x. plG onRow: h y. plG onCol: h x.! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:21' prior: 34005253! dump 1 to: height do: [:j | 1 to: width do: [:i | (plR onRow = j and: [plR onCol = i]) ifTrue: [ Transcript show: plR color. ] ifFalse: [ (plB onRow = j and: [plB onCol = i]) ifTrue: [ Transcript show: plB color. ] ifFalse: [ (plG onRow = j and: [plG onCol = i]) ifTrue: [ Transcript show: plG color. ] ifFalse: [ Transcript show: (((fields at: j) at: i) getChar). ] ] ] ]. Transcript cr. ].! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/25/2011 14:21' prior: 34130388! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. Transcript show: ' '. Transcript show: fieldMap plB score. Transcript show: ' '. Transcript show: fieldMap plG score. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. "fieldMap dump."! ! PacmanApp new.! ----QUIT----{25 June 2011 . 2:24:23 pm} Squeak4.1.image priorSource: 657523! ----STARTUP----{25 June 2011 . 2:38:56 pm} as /home/michael/Progs/Foop/temp/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! ----QUIT----{25 June 2011 . 2:39:27 pm} Squeak4.1.image priorSource: 673273! ----STARTUP----{26 June 2011 . 8:04 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:20' prior: 34222987! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/green.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:22' prior: 34218659! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 1 x: col y: row. ] ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! PacmanApp new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:25' prior: 34229145! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] "red ... index 4" ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] "blue = index 2" ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] "green = index 3" ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! PacmanApp new.! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 20:48'! initialize IconicButton new openInWorld.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:49' prior: 34021561! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:49' prior: 34230873! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu initalize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:50' prior: 34231175! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu initialize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:51' prior: 34231498! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu position: 50 @ 20. gamemenu initialize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:51' prior: 34231822! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu position: 50@20. gamemenu initialize. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:52' prior: 34232175! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu initialize. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:52' prior: 34230738! initialize | button | button := IconicButton new. button position: 50@20. button openInWorld. ! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 20:59' prior: 34232849! initialize | button | button := IconicButton new. button position: 50@20. button openeWorld. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:00' prior: 34233058! initialize | button | button := IconicButton new. button position: 50@20. "button openeWorld." ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:00' prior: 34232526! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openeWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:01' prior: 34233443! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:01' prior: 34233767! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. GameMenu new openeWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:02' prior: 34234092! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. GameMenu new openInWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:03' prior: 34234395! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu position: 50@20. gamemenu openInWorld. fieldMap draw.! ! ----STARTUP----{26 June 2011 . 9:06:12 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:07' prior: 34222987! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/green.jpg') asMorph. form position: ((((x-1)*16)+4) + offsetX)@((((y-1)*16)+4) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:08' prior: 34218659! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] "blue ... index 2" ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] "green ... index 3" ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:09' prior: 34236070! drawTileRow: row Col: col | color | row ifNil: [ ^ false ]. col ifNil: [ ^ false ]. "TODO redraw tile specified by row and col" "change" map redrawFieldX: col y: row. (plR onRow = row and: [plR onCol = col]) ifTrue: [ map renderPlayer: 4 x: col y: row. ] "red ... index 4" ifFalse: [ (plB onRow = row and: [plB onCol = col]) ifTrue: [map renderPlayer: 2 x: col y: row. ] "blue ... index 2" ifFalse: [ (plG onRow = row and: [plG onCol = col]) ifTrue: [ map renderPlayer: 3 x: col y: row. ] "green ... index 3" ] ]. (((fields at: row) at: col) isWall) ifTrue: [ color := ((fields at: row) at: col) getChar. map wallColor: color x: col y: row. ]. ^ true. ! ! PacmanApp new.! ----QUIT----{26 June 2011 . 9:10:12 pm} Squeak4.1.image priorSource: 673530! ----STARTUP----{26 June 2011 . 9:10:16 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 21:11'! initialize self position: 50@20.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:12' prior: 34021561! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:35' prior: 34237898! initialize "self position: 50@20." ! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:36' prior: 34238025! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openeWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:37' prior: 34238475! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInWorld. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:48' prior: 34238328! initialize super initialize self position: 50@20. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 21:49' prior: 34239123! initialize super initialize. self position: 50@20. ! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:17' prior: 34238799! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu ActiveWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:19' prior: 34239432! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInHand. fieldMap draw.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:19' prior: 34239757! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openMorphicWorld. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:20' prior: 34240098! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu displayAt: 50@20. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:25' prior: 34240428! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu show. fieldMap draw.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 22:27' prior: 34240758! initialize | gamemenu | super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gamemenu := GameMenu new. gamemenu openInWorld. fieldMap draw.! ! ----STARTUP----{26 June 2011 . 10:30:48 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:12'! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2; borderColor: #raised. btn label color: Color darkGray. ^ btn.! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 23:22'! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil).! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 23:22'! startGame "comment stating purpose of message" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:26' prior: 34242080! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil) fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated)))).! ! ----QUIT----{26 June 2011 . 11:26:17 pm} Squeak4.1.image priorSource: 683167! ----STARTUP----{26 June 2011 . 11:26:19 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:27' prior: 34242660! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil) fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated)))). ^ panel! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/26/2011 23:33'! initialize "comment stating purpose of message" | form | super initialize. form := Form extent: self makeControlPanel depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:34' prior: 34021561! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. GameMenu new. fieldMap draw.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:36' prior: 34244124! initialize "comment stating purpose of message" | form | super initialize. form := Form extent: (self makeControlPanel) depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:38' prior: 34244694! initialize "comment stating purpose of message" | form | super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeControlPanel) depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:39' prior: 34244973! initialize "comment stating purpose of message" | form | super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form displayAt: 50@50.! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/26/2011 23:41' prior: 34241565! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2; borderColor: #raised. btn label color: Color darkGray. Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:01' prior: 34245291! initialize "comment stating purpose of message" | form | super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:04' prior: 34245665! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray. Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:05' prior: 34246672! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. "labelmorph emphasis: 1." "btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray." Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:07' prior: 34246283! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50.! ! PacmanApp new.! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap gameMenu' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 00:07' prior: 34244402! initialize super initialize. fieldMap := FieldMap new. self step. ActiveHand newKeyboardFocus: self. self position: 20 @ 20; openInWorld. gameMenu := GameMenu new. fieldMap draw.! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:17:03 am} Squeak4.1.image priorSource: 688760! ----STARTUP----{27 June 2011 . 9:29:26 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:32' prior: 34247830! initialize "comment stating purpose of message" | temp | super initialize. Transcript show: 'initialize called'. "form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50." temp := self makeButton: 'start game' action: #startGame state: nil.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:32' prior: 34248926! initialize "comment stating purpose of message" | temp | super initialize. Transcript show: 'initialize called'. "form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50." temp := self makeButton: 'start game' action: #startGame state: nil. temp openInWorld.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:33' prior: 34247249! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray. Transcript show: 'finished button'. ^ btn.! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:35' prior: 34242519! startGame "comment stating purpose of message" Transcript show: 'start game called'. ! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:36' prior: 34249370! initialize "comment stating purpose of message" | temp | super initialize. Transcript show: 'initialize called'. "form := Form extent: (self makeButton: 'start game' action: #startGame state: nil) depth: Display depth. form fillColor: (Color black). form displayAt: 50@50." temp := self makeControlPanel. temp openInWorld.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:41' prior: 34243525! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:51' prior: 34251083! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:52' prior: 34251734! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 09:53' prior: 34252439! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:02' prior: 34253157! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:03' prior: 34253898! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:07' prior: 34254658! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 40@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'blabla'. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:10' prior: 34255420! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 10@10. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:10' prior: 34256225! makeControlPanel | panel buttonHeight vertOffsetTop vertOffsetBtm temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. buttonHeight := 26. vertOffsetTop := 10 + buttonHeight + 10 + buttonHeight. vertOffsetBtm := 10 + buttonHeight + 10. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 30@10. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:10' prior: 34257138! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 30@10. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:13' prior: 34258051! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:27' prior: 34258822! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@60. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:30' prior: 34259610! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: '2'. temp position: 50@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:30' prior: 34260482! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: '2'. temp position: 70@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:31' prior: 34261354! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. temp := TextMorph new. temp contents: '2'. temp position: 70@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. temp := TextMorph new. temp contents: '3'. temp position: 70@30. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! Morph subclass: #GameMenu instanceVariableNames: 'form map rounds player' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:35' prior: 34262226! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:36' prior: 34250444! startGame "comment stating purpose of message" Transcript show: 'start game called' + (player text) + (rounds text). ! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:37' prior: 34264302! startGame "comment stating purpose of message" Transcript show: player text. ! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:54' prior: 34263338! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. "red player controls" temp := StringMorph new. temp contents: 'Ges. Punkte: 0'. temp position: 10@60. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden Punkte: 0'. temp position: 10@90. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 10:55' prior: 34264737! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden: '. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler: '. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. "red player controls" temp := StringMorph new. temp contents: 'Ges. Punkte: 0'. temp position: 10@60. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden Punkte: 0'. temp position: 10@70. panel addMorph: temp. "fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (( 20 @ (vertOffsetTop negated)) corner: (-20 @ (vertOffsetBtm negated))))." ^ panel! ! ----STARTUP----{27 June 2011 . 10:58:09 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:01' prior: 34243525! makeControlPanel | panel | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:02' prior: 34267324! makeControlPanel | panel | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. panel addMorph: (self makeButton: 'start game' action: #startGame state: nil). ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:03' prior: 34247830! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:04' prior: 34267646! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:04' prior: 34247249! makeButton: label action: actionSymbol state: stateSymbol | btn labelmorph | btn := PluggableButtonMorph on: self getState: stateSymbol action: actionSymbol. labelmorph := StringMorph contents: label. labelmorph emphasis: 1. btn label: labelmorph; useRoundedCorners; hResizing: #spaceFill; onColor: Color veryLightGray offColor: Color lightGray; borderWidth: 2. btn label color: Color darkGray. ^ btn.! ! PacmanApp new.! ----QUIT----{27 June 2011 . 11:45:39 am} Squeak4.1.image priorSource: 694162! ----STARTUP----{27 June 2011 . 11:45:42 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:46' prior: 34268276! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. temp := StringMorph new. temp content: 'Runden'. temp position: 10@10. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:47' prior: 34269455! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden'. temp position: 10@10. panel addMorph: temp. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:48' prior: 34269934! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden'. temp position: 10@10. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:49' prior: 34270431! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@10. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:49' prior: 34270934! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 11:49:56 am} Squeak4.1.image priorSource: 714690! ----STARTUP----{27 June 2011 . 11:49:59 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:51' prior: 34271542! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 10@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:51' prior: 34272557! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 50@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! PacmanApp new.! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:52' prior: 34273266! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 11:53' prior: 34274009! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 11:53:48 am} Squeak4.1.image priorSource: 717645! ----STARTUP----{27 June 2011 . 11:53:51 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:31' prior: 34274735! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrRPoints := StringMorph new. player contents: 'Punkte: 0'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:32' prior: 34276023! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@40. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:35' prior: 34276900! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrRPoints. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@90. panel addMorph: plrRPoints. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:36' prior: 34277856! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@90. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:36' prior: 34279036! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! ----QUIT----{27 June 2011 . 12:36:56 pm} Squeak4.1.image priorSource: 721042! ----STARTUP----{27 June 2011 . 12:36:59 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:37' prior: 34280234! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp textColor: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:39' prior: 34281658! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp textColor: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. plrROverall textColor: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:42' prior: 34282867! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. "plrROverall textColor: Color red." panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:43' prior: 34284111! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Spieler Rot'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@70. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@85. plrRPoints color: Color red. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:44' prior: 34285370! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:44:52 pm} Squeak4.1.image priorSource: 726893! ----STARTUP----{27 June 2011 . 12:44:54 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:46' prior: 34286653! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 40@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 40@65. plrGPoints color: Color green. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:46' prior: 34288050! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 80@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 80@65. plrGPoints color: Color green. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:47' prior: 34289531! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:48' prior: 34291012! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrGPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:49' prior: 34292495! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. plrROverall := StringMorph new. plrROverall contents: 'Gesamtpunkte: 0'. plrROverall position: 10@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:50:27 pm} Squeak4.1.image priorSource: 733285! ----STARTUP----{27 June 2011 . 12:50:29 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:53' prior: 34294307! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 100@50. plrROverall color: Color red. panel addMorph: plrROverall. plrRPoints := StringMorph new. plrRPoints contents: 'Punkte: 0'. plrRPoints position: 10@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:54' prior: 34296362! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 100@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 100@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:55' prior: 34298291! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. plrGOverall := StringMorph new. plrGOverall contents: 'Gesamtpunkte: 0'. plrGOverall position: 120@50. plrGOverall color: Color green. panel addMorph: plrGOverall. plrGPoints := StringMorph new. plrGPoints contents: 'Punkte: 0'. plrGPoints position: 120@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 12:57' prior: 34300338! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. plrBOverall := StringMorph new. plrBOverall contents: 'Gesamtpunkte: 0'. plrBOverall position: 230@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. plrBPoints := StringMorph new. plrBPoints contents: 'Punkte: 0'. plrBPoints position: 230@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 12:57:53 pm} Squeak4.1.image priorSource: 741597! ----STARTUP----{27 June 2011 . 12:57:56 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:01' prior: 34302385! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 1:01:52 pm} Squeak4.1.image priorSource: 750148! ----STARTUP----{27 June 2011 . 1:01:55 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:04'! setPoints: points player: player "comment stating purpose of message" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:07'! setPoints: points playerChar: playerChar "comment stating purpose of message" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:10' prior: 34307808! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints setContents: (plrRPoints contents) + points.].! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:11' prior: 34304913! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: 10 playerChar: 'r'. ^ panel! ! ----QUIT----{27 June 2011 . 1:11:58 pm} Squeak4.1.image priorSource: 752913! ----STARTUP----{27 June 2011 . 1:12:01 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:12' prior: 34307980! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: (plrRPoints contents) + points.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:13' prior: 34311042! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: ((plrRPoints contents) + points).].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:14' prior: 34308257! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: 0. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: 10 playerChar: 'r'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:14' prior: 34311558! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: 0. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: 10 playerChar: 'r'." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:15' prior: 34314100! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: 10 playerChar: 'r'." ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:16' prior: 34311299! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: points.].! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:17' prior: 34319207! setPoints: points playerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [plrRPoints contents: points.]. (playerChar = 'g') ifTrue: [plrRPoints contents: points.]. (playerChar = 'b') ifTrue: [plrRPoints contents: points.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:17' prior: 34316644! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: 10 playerChar: 'r'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:18' prior: 34319814! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:20' prior: 34322358! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:20' prior: 34324921! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:22' prior: 34319457! setPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.]. (playerChar = 'r') ifTrue: [plrRPoints contents: points.]. (playerChar = 'g') ifTrue: [plrRPoints contents: points.]. (playerChar = 'b') ifTrue: [plrRPoints contents: points.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:22' prior: 34330015! setPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'g') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'b') ifTrue: [plrRPoints contents: temp.].! ! PacmanApp new.! ----QUIT----{27 June 2011 . 1:23:07 pm} Squeak4.1.image priorSource: 756279! ----STARTUP----{27 June 2011 . 1:23:10 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'nil' stamp: 'mr 6/27/2011 13:23'! setOverallPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'g') ifTrue: [plrGOverall contents: temp.]. (playerChar = 'b') ifTrue: [plrRPoints contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:24' prior: 34331136! setOverallPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrROverall contents: temp.]. (playerChar = 'g') ifTrue: [plrGOverall contents: temp.]. (playerChar = 'b') ifTrue: [plrBOverall contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:24' prior: 34330450! setPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrRPoints contents: temp.]. (playerChar = 'g') ifTrue: [plrGPoints contents: temp.]. (playerChar = 'b') ifTrue: [plrBPoints contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 13:26' prior: 34327469! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 400. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! PacmanApp new.! ----QUIT----{27 June 2011 . 1:27:37 pm} Squeak4.1.image priorSource: 776405! ----STARTUP----{27 June 2011 . 1:34:34 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! Morph subclass: #Map instanceVariableNames: 'template fields x y players points offsetX offsetY' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:09' prior: 34214192! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:09' prior: 34335563! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:10' prior: 34339802! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. self addMorph: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:10' prior: 34344029! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. self addMorph: temp. temp openInWorld. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 15:22' prior: 34348298! initialize | pics blockType temp | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ temp := (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). (fields at: j) at: i put: temp. self addMorph: temp. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! ----QUIT/NOSAVE----{27 June 2011 . 3:27:22 pm} Squeak4.1.image priorSource: 780619! ----STARTUP----{27 June 2011 . 3:27:25 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:40' prior: 34332534! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 200. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:40' prior: 34357090! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 600. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:41' prior: 34359697! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'. ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:44'! startPacmanApp: app "" ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:45' prior: 34364878! startPacmanApp: app "" app step. ActiveHand newKeyboardFocus: app. app position: 20 @ 20; openInWorld.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:48' prior: 34364996! startPacmanApp: app "" app step. ActiveHand newKeyboardFocus: app. app position: 300 @ 20. form addMorph: app.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:48' prior: 34248380! initialize super initialize. fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw.! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:49' prior: 34365406! initialize super initialize. fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:50' prior: 34365656! initialize super initialize. fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw.! ! PacmanApp new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:52' prior: 34331604! setOverallPoints: points playerChar: playerChar "comment stating purpose of message" | temp | (points isInteger) ifTrue: [temp := points asStringWithCommas.] ifFalse: [temp := points.]. (playerChar = 'r') ifTrue: [plrROverall contents: temp.]. (playerChar = 'g') ifTrue: [plrGOverall contents: temp.]. (playerChar = 'b') ifTrue: [plrBOverall contents: temp.].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 15:52' prior: 34362304! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'." ^ panel! ! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:19' prior: 34214192! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = '#' ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:20' prior: 34369179! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:20' prior: 34373396! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $ ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:20' prior: 34377612! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = ' ' ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:21' prior: 34381828! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) = $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! ----QUIT----{27 June 2011 . 5:21:52 pm} Squeak4.1.image priorSource: 780619! ----STARTUP----{27 June 2011 . 5:21:56 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:22' prior: 34386046! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) ~= $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) ~= $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) ~= $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) ~= $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:27' prior: 34390504! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) = $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) = $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) = $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) = $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:31' prior: 34394722! initialize | pics blockType | super initialize. offsetX := 300. offsetY := 400. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) = $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) = $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) = $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) = $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 17:33' prior: 34235227! wallColor: color x: x y: y "comment stating purpose of message" | form | (color = 'r') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/red.jpg') asMorph. form position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). form imageForm display. ]. (color = 'b') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/blue.jpg') asMorph. form position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). form imageForm display. ]. (color = 'g') ifTrue: [ form := (Form fromFileNamed: './pacman_pics/green.jpg') asMorph. form position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). form imageForm display. ]. (color = '+') ifTrue: [self redrawFieldX: x y: y.]. ! ! PacmanApp new.! PacmanApp new.! !Map methodsFor: 'as yet unclassified' stamp: 'mr 6/27/2011 17:41' prior: 34206224! renderPlayer: playerId x: x y: y "render player at a given coordinate" | player | player := players at: playerId. player position: ((((x-1)*16)) + offsetX)@((((y-1)*16)) + offsetY). player imageForm display.! ! PacmanApp new.! !Map methodsFor: 'initialize-release' stamp: 'mr 6/27/2011 17:44' prior: 34398953! initialize | pics blockType | super initialize. offsetX := 10. offsetY := 120. "setting up the grid" x := 35. y := 17. "setting up template" template := Array new: y. template at: 1 put: ' # # '. template at: 2 put: ' #### ###### # #### # # ###### ### '. template at: 3 put: ' # # '. template at: 4 put: ' # ##### # # # # # ### # # # '. template at: 5 put: ' # # # # # # # # # # ## # # '. template at: 6 put: ' # # # # # # # # ### # # # # '. template at: 7 put: ' # # # # # # # # # # # # ## # '. template at: 8 put: ' # # ### ##### # ### # # # '. template at: 9 put: ' ### # '. template at: 10 put: ' # # ### #### #### #### ##### '. template at: 11 put: ' #### # #..# #..# #..# # # '. template at: 12 put: ' # # ### #..# #..# #### # # # # '. template at: 13 put: ' # # # #..# #..# # # '. template at: 14 put: ' # #### # #### #### # # ##### # '. template at: 15 put: ' # # '. template at: 16 put: ' #### ###### # ##### # ####### ### '. template at: 17 put: ' # # '. "set up fields and render map" fields := Array new: y. 1 to: y do: [:i | fields at: i put: (Array new: x)]. "set up fields and render map" points := Array new: y. 1 to: y do: [:i | points at: i put: (Array new: x)]. "indexing filenames of map element .png" pics := Array new: 16. pics at: 1 put: './pacman_pics/block0.jpg'. pics at: 2 put: './pacman_pics/block1.jpg'. pics at: 3 put: './pacman_pics/block2.jpg'. pics at: 4 put: './pacman_pics/block3.jpg'. pics at: 5 put: './pacman_pics/block4.jpg'. pics at: 6 put: './pacman_pics/block5.jpg'. pics at: 7 put: './pacman_pics/block6.jpg'. pics at: 8 put: './pacman_pics/block7.jpg'. pics at: 9 put: './pacman_pics/block8.jpg'. pics at: 10 put: './pacman_pics/block9.jpg'. pics at: 11 put: './pacman_pics/block10.jpg'. pics at: 12 put: './pacman_pics/block11.jpg'. pics at: 13 put: './pacman_pics/block12.jpg'. pics at: 14 put: './pacman_pics/block13.jpg'. pics at: 15 put: './pacman_pics/block14.jpg'. pics at: 16 put: './pacman_pics/block15.jpg'. "((Form fromFileNamed: (pics at: 1)) displayAt: 100@100) asMorph." 1 to: y do: [:j | 1 to: x do: [:i | ((template at: j) at: i) ~= $# ifTrue: [ (fields at: j) at: i put: (((Form fromFileNamed: './pacman_pics/black.jpg') displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). "render point" ((template at: j) at: i) ~= $. ifTrue: [ (points at: j) at: i put: (((Form fromFileNamed: './pacman_pics/point.jpg') displayAt: (offsetX + (((i-1)*16)+4))@(offsetY + (((j-1)*16)+4))) asMorph). ]. ] ifFalse: [ blockType := 0. "check if field to the left is free" (i >1) ifTrue: [((template at: j) at: i - 1) = $# ifTrue: [blockType := blockType + 1]]. "check if field to the right is free" (i < x) ifTrue: [((template at: j) at: i + 1) = $# ifTrue: [blockType := blockType + 2]]. "check if field above is free" (j > 1) ifTrue: [((template at: j - 1) at: i) = $# ifTrue: [blockType := blockType + 4]]. "check if field below is free" (j < y) ifTrue: [((template at: j + 1) at: i) = $# ifTrue: [blockType := blockType + 8]]. "render labyrinth" (fields at: j) at: i put: (((Form fromFileNamed: (pics at: blockType+1)) displayAt: (offsetX + ((i-1)*16))@(offsetY + ((j-1)*16))) asMorph). ]. ]. ]. "draw player one for testing" players := Array new: 4. players at: 1 put: ((Form fromFileNamed: './pacman_pics/player1.jpg') asMorph). "self renderPlayer: 1 x: 1 y: 1." players at: 2 put: ((Form fromFileNamed: './pacman_pics/player2.jpg') asMorph). "self renderPlayer: 2 x: 5 y: 17." players at: 3 put: ((Form fromFileNamed: './pacman_pics/player3.jpg') asMorph). "self renderPlayer: 3 x: 35 y: 1." players at: 4 put: ((Form fromFileNamed: './pacman_pics/player4.jpg') asMorph). "self renderPlayer: 4 x: 35 y: 17." ! ! PacmanApp new.! PacmanApp new.! ----QUIT----{27 June 2011 . 5:45:31 pm} Squeak4.1.image priorSource: 835747! ----STARTUP----{28 June 2011 . 11:15:05 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 11:23' prior: 34226475! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. Transcript show: ' '. Transcript show: fieldMap plB totalScore. Transcript show: ' '. Transcript show: fieldMap plG totalScore. Transcript cr. "fieldMap dump."! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 11:25' prior: 34408848! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB totalScore. gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG totalScore. gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. "fieldMap dump."! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:22' prior: 34014759! stepTime "Answer the desired time between steps in milliseconds." ^ 2000! ! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:23' prior: 34412042! stepTime "Answer the desired time between steps in milliseconds." ^ 500! ! PacmanApp new.! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:27' prior: 34412228! stepTime "Answer the desired time between steps in milliseconds." ^ 100! ! PacmanApp new.! PacmanApp new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:46' prior: 34365883! initialize super initialize. "fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw."! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:47' prior: 34268007! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. "fieldMap := FieldMap new. gameMenu := GameMenu new. gameMenu startPacmanApp: self. fieldMap draw."! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:48' prior: 34412858! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. fieldMap := FieldMap new. "gameMenu := GameMenu new." "gameMenu startPacmanApp: self." fieldMap draw.! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:49' prior: 34413441! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." "gameMenu startPacmanApp: self." fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:50' prior: 34414036! initialize "comment stating purpose of message" super initialize. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:50' prior: 34242519! startGame "comment stating purpose of message" fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." self startPacmanApp: pacmanApp. fieldMap draw.! ! PacmanApp new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:52'! initializeMap: map menu: menu super initialize. fieldMap := map. gameMenu := menu ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:53' prior: 34412632! initialize super initialize. "fieldMap := map. gameMenu := menu" ! ! !PacmanApp methodsFor: 'nil' stamp: 'mr 6/28/2011 12:53'! setMap: map menu: menu "comment stating purpose of message" ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:54' prior: 34415153! initialize super initialize. ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:54' prior: 34415284! setMap: map menu: menu "comment stating purpose of message" fieldMap := map. gameMenu := menu.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 12:54' prior: 34414681! startGame "comment stating purpose of message" fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:48'! startRound "comment stating purpose of message" fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:51' prior: 34415756! startGame "comment stating purpose of message" numRounds := rounds content. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:52' prior: 34366593! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := self makeButton: 'new round' action: #startRound state: nil. temp position: 250@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := StringMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'." ^ panel! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:54' prior: 34416630! startGame "comment stating purpose of message" numRounds := (rounds content) asInteger. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:54' prior: 34419695! startGame "comment stating purpose of message" numRounds := (rounds content) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:55' prior: 34420057! startGame "comment stating purpose of message" numRounds := (rounds contents) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:57' prior: 34420492! startGame "comment stating purpose of message" numRounds := (rounds text) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:57' prior: 34420928! startGame "comment stating purpose of message" numRounds := (rounds text) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:57' prior: 34421360! startGame "comment stating purpose of message" numRounds := (rounds asText) asInteger. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:58' prior: 34421792! startGame "comment stating purpose of message" numRounds := (rounds asText). "asInteger." Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 13:59' prior: 34422226! startGame "comment stating purpose of message" numRounds := (rounds contents). "asInteger." Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:01' prior: 34422663! startGame "comment stating purpose of message" numRounds := (rounds contents) asNumber. Transcript show: 'rounds'. Transcript show: numRounds. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:04' prior: 34423102! startGame "comment stating purpose of message" numRounds := (rounds contents) asNumber. rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'nil' stamp: 'mr 6/28/2011 14:05'! finishGame Transcript show: 'Game over'.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:05' prior: 34416070! startRound "comment stating purpose of message" rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:10' prior: 34424070! startRound "comment stating purpose of message" | temp | temp := (plrRPoints contents) asNumber. rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:12'! getPointsPlayerChar: playerChar "comment stating purpose of message" | | (playerChar = 'r') ifTrue: [^ ((plrRPoints contents) asNumber).]. (playerChar = 'g') ifTrue: [^ ((plrGPoints contents) asNumber).]. (playerChar = 'b') ifTrue: [^ ((plrBPoints contents) asNumber).].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:13'! getOverallPointsPlayerChar: playerChar "comment stating purpose of message" (playerChar = 'r') ifTrue: [^ ((plrROverall contents) asNumber).]. (playerChar = 'g') ifTrue: [^ ((plrGOverall contents) asNumber).]. (playerChar = 'b') ifTrue: [^ ((plrBOverall contents) asNumber).].! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:15' prior: 34424454! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:15' prior: 34425618! startRound "comment stating purpose of message" "self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'." rounds := rounds - 1. (rounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:18' prior: 34426121! startRound "comment stating purpose of message" "self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'." numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:18' prior: 34423537! startGame "comment stating purpose of message" numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:22' prior: 34426658! startRound "comment stating purpose of message" "self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'." numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:24' prior: 34410346! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. fieldMap startNewRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:25' prior: 34427628! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:27' prior: 34429878! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame.]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:27' prior: 34430425! startRound "comment stating purpose of message" self setOverallPoints: ( (self getPointsPlayerChar: 'r') + (self getOverallPointsPlayerChar: 'r')) playerChar: 'r'. self setOverallPoints: ( (self getPointsPlayerChar: 'g') + (self getOverallPointsPlayerChar: 'g')) playerChar: 'g'. self setOverallPoints: ( (self getPointsPlayerChar: 'b') + (self getOverallPointsPlayerChar: 'b')) playerChar: 'b'. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame.]. fieldMap := FieldMap new. pacmanApp delete. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:30' prior: 34427172! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:31' prior: 34431719! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. self inform: 'heyho'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:32' prior: 34432417! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:36' prior: 34423936! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) && ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Press "start game" to play again!!'.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:36' prior: 34433820! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) && ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) && ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Winner: ' + winner.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:38' prior: 34434634! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) & ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Winner: ' + winner.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:39' prior: 34435447! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) & ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := 'blue']. self inform: 'Game Finished. Winner: ' , winner.! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:42' prior: 34436257! finishGame | winner | winner := ''. (((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'r') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := 'red']. (((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'r')) & ((self getOverallPointsPlayerChar: 'g') >= (self getOverallPointsPlayerChar: 'b'))) ifTrue: [winner := winner , 'green']. (((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'g')) & ((self getOverallPointsPlayerChar: 'b') >= (self getOverallPointsPlayerChar: 'r'))) ifTrue: [winner := winner , 'blue']. self inform: 'Game Finished. Winner: ' , winner.! ! ----QUIT----{28 June 2011 . 2:45:27 pm} Squeak4.1.image priorSource: 854066! ----STARTUP----{28 June 2011 . 2:55:45 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 14:59' prior: 34428178! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." gameMenu startRound. fieldMap draw. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:02' prior: 34438121! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." gameMenu startRound. "fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! GameMenu new.! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:09' prior: 34439864! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." fieldMap draw. gameMenu startRound. "fieldMap draw." ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:11' prior: 34441641! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. fieldMap movePlB: keyPlB. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! Object subclass: #FieldMap instanceVariableNames: 'width height fields plR plB plG oldPlRrow oldPlRcol oldPlBrow oldPlBcol oldPlGrow oldPlGcol coloredWall coloredWallRow coloredWallCol map gameMenu' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !FieldMap methodsFor: 'nil' stamp: 'mr 6/28/2011 15:18'! setGameMenu: menu "comment stating purpose of message" gameMenu := menu.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:18' prior: 34414973! initializeMap: map menu: menu super initialize. fieldMap := map. map setGameMenu: menu. gameMenu := menu ! ! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:21' prior: 34121701! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green.' ; cr. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red.' ; cr. ^ true ]. ^ false.! ! GameMenu new.! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:24' prior: 34445553! initializeMap: map menu: menu super initialize. fieldMap := map. fieldMap setGameMenu: menu. gameMenu := menu ! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:28' prior: 34433139! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !FieldMap methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 15:31' prior: 34445756! calcCatched | plWallColor | coloredWall ifNotNil: [ (coloredWall color = 'R') ifTrue: [ plWallColor := plR ]. (coloredWall color = 'B') ifTrue: [ plWallColor := plB ]. (coloredWall color = 'G') ifTrue: [ plWallColor := plG ]. ]. ((plR onCol = plB onCol and: [ plR onRow = plB onRow ]) or: [ plR onCol = oldPlBcol and: [ plR onRow = oldPlBrow and: [ plB onCol = oldPlRcol and: [ plB onRow = oldPlRrow ] ] ] ]) ifTrue: [ plR score: plR score + plB score. plB score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true. ]. ((plR isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plR color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plR score. plR score: 0. Transcript show: 'Red catched Blue.' ; cr. gameMenu setPoints: (plR score) playerChar: 'r'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plB onCol = plG onCol and: [ plB onRow = plG onRow ]) or: [ plB onCol = oldPlGcol and: [ plB onRow = oldPlGrow and: [ plG onCol = oldPlBcol and: [ plG onRow = oldPlBrow ] ] ] ]) ifTrue: [ plB score: plB score + plG score. plG score: 0. Transcript show: 'Blue catched Green.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plB isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plB color = coloredWall color) not] ) ifTrue: [ plWallColor score: plWallColor score + plB score. plB score: 0. Transcript show: 'Blue catched Green.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plB score) playerChar: 'b'. ^ true ]. ((plG onCol = plR onCol and: [ plG onRow = plR onRow ]) or: [ plG onCol = oldPlRcol and: [ plG onRow = oldPlRrow and: [ plR onCol = oldPlGcol and: [ plR onRow = oldPlGrow ] ] ] ]) ifTrue: [ plG score: plG score + plR score. plR score: 0. Transcript show: 'Green catched Red.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plR score) playerChar: 'r'. ^ true ]. ((plG isOnRow: coloredWallRow Col: coloredWallCol) and: [ (plG color = coloredWall color) not ]) ifTrue: [ plWallColor score: plWallColor score + plG score. plG score: 0. Transcript show: 'Green catched Red.' ; cr. gameMenu setPoints: (plG score) playerChar: 'g'. gameMenu setPoints: (plR score) playerChar: 'r'. ^ true ]. ^ false.! ! ----QUIT----{28 June 2011 . 3:32:58 pm} Squeak4.1.image priorSource: 883357! ----STARTUP----{28 June 2011 . 6:05:28 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds numPlayer' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:09' prior: 34448239! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid player size'. ^ ''. ]. numRounds := (rounds contents) asNumber. (numRounds < 1) ifTrue:[ self inform: 'invalid number of rounds'. ^ ''. ]. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap gameMenu botPlB botPlG' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:15' prior: 34415439! initialize super initialize. botPlB := false. botPlG := false. ! ! !PacmanApp methodsFor: 'nil' stamp: 'mr 6/28/2011 18:16'! setBotPlB: value "" botPlB := value.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:16'! setBotPlG: value "" botPlG := value.! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:18' prior: 34452128! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid player size'. ^ ''. ]. numRounds := (rounds contents) asNumber. (numRounds < 1) ifTrue:[ self inform: 'invalid number of rounds'. ^ ''. ]. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. (numPlayer < 3) ifTrue: [pacmanApp setBotPlG: true]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlB: true]. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:21' prior: 34443388! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! ----STARTUP----{28 June 2011 . 6:22:14 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! GameMenu new.! TextMorph subclass: #PacmanApp instanceVariableNames: 'keyPlR keyPlB keyPlG fieldMap gameMenu botPlB botPlG' classVariableNames: '' poolDictionaries: '' category: 'Pacman-App'! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:43'! setBotPlB: value "" botPlB := false.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:43'! setBotPlG: value "" botPlG := value.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:43' prior: 34456849! setBotPlB: value "" botPlB := value.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:44' prior: 34415439! initialize super initialize. botPlG := false. botPlB := false. ! ! GameMenu new.! GameMenu new.! ----QUIT----{28 June 2011 . 6:44:52 pm} Squeak4.1.image priorSource: 897110! ----STARTUP----{28 June 2011 . 6:44:55 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:45' prior: 34443388! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifFalse: [fieldMap movePlB: keyPlB.]. fieldMap movePlG: keyPlG. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:46' prior: 34457665! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:49'! randomDirection | c | c := 4 atRandom. (c=1) ifTrue: [ ^ #goLeft ]. (c=2) ifTrue: [ ^ #goUp ]. (c=3) ifTrue: [^ #goRight]. ^ #goDown.! ! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:50' prior: 34459446! step | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifTrue: [fieldMap movePlB: (self randomDirection).] ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifTrue: [fieldMap movePlG: (self randomDirection).] ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! ----QUIT----{28 June 2011 . 6:50:35 pm} Squeak4.1.image priorSource: 902901! ----STARTUP----{28 June 2011 . 6:50:38 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! GameMenu new.! ----QUIT----{28 June 2011 . 6:51:13 pm} Squeak4.1.image priorSource: 908830! ----STARTUP----{28 June 2011 . 6:51:16 pm} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:51' prior: 34448239! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds numPlayer' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:53' prior: 34463850! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ true. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:54' prior: 34464819! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:58' prior: 34465731! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 18:58' prior: 34416980! makeControlPanel | panel temp | panel := RectangleMorph new borderWidth: 0; color: Color white; layoutPolicy: ProportionalLayout new. panel width: 450. panel height: 100. temp := self makeButton: 'start game' action: #startGame state: nil. temp position: 80@10. panel addMorph: temp. temp := self makeButton: 'new round' action: #startRound state: nil. temp position: 250@10. panel addMorph: temp. temp := StringMorph new. temp contents: 'Runden:'. temp position: 10@10. panel addMorph: temp. rounds := TextMorph new. rounds contents: '2'. rounds position: 70@10. panel addMorph: rounds. temp := StringMorph new. temp contents: 'Spieler:'. temp position: 10@30. panel addMorph: temp. player := TextMorph new. player contents: '3'. player position: 70@30. panel addMorph: player. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 10@50. temp color: Color red. panel addMorph: temp. plrROverall := StringMorph new. plrROverall contents: '0'. plrROverall position: 110@50. plrROverall color: Color red. panel addMorph: plrROverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 10@65. temp color: Color red. panel addMorph: temp. plrRPoints := StringMorph new. plrRPoints contents: '0'. plrRPoints position: 110@65. plrRPoints color: Color red. panel addMorph: plrRPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 140@50. temp color: Color green. panel addMorph: temp. plrGOverall := StringMorph new. plrGOverall contents: '0'. plrGOverall position: 240@50. plrGOverall color: Color green. panel addMorph: plrGOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 140@65. temp color: Color green. panel addMorph: temp. plrGPoints := StringMorph new. plrGPoints contents: '0'. plrGPoints position: 240@65. plrGPoints color: Color green. panel addMorph: plrGPoints. temp := StringMorph new. temp contents: 'Gesamtpunkte:'. temp position: 270@50. temp color: Color blue. panel addMorph: temp. plrBOverall := StringMorph new. plrBOverall contents: '0'. plrBOverall position: 370@50. plrBOverall color: Color blue. panel addMorph: plrBOverall. temp := StringMorph new. temp contents: 'Punkte'. temp position: 270@65. temp color: Color blue. panel addMorph: temp. plrBPoints := StringMorph new. plrBPoints contents: '0'. plrBPoints position: 370@65. plrBPoints color: Color blue. panel addMorph: plrBPoints. "self setPoints: '10' playerChar: 'r'. self setOverallPoints: 20 playerChar: 'g'." ^ panel! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 19:00' prior: 34466596! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/28/2011 19:05' prior: 34461218! randomDirection | c | c := 4 atRandom. (c=1) ifTrue: [ ^ #goLeft:. ]. (c=2) ifTrue: [ ^ #goUp:. ]. (c=3) ifTrue: [^ #goRight:.]. ^ #goDown:.! ! GameMenu new.! GameMenu new.! GameMenu new.! ----QUIT----{28 June 2011 . 7:07:42 pm} Squeak4.1.image priorSource: 909087! ----STARTUP----{29 June 2011 . 8:31:34 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:31' prior: 34412430! stepTime "Answer the desired time between steps in milliseconds." ^ 300! ! GameMenu new.! !PacmanApp methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:33' prior: 34461457! step "code that is executed by the timer" | | super step. Transcript show: keyPlR. Transcript show: ' '. Transcript show: keyPlB. Transcript show: ' '. Transcript show: keyPlG. Transcript cr. fieldMap rememberOldPlPos. fieldMap movePlR: keyPlR. (botPlB) ifTrue: [fieldMap movePlB: (self randomDirection).] ifFalse: [fieldMap movePlB: keyPlB.]. (botPlG) ifTrue: [fieldMap movePlG: (self randomDirection).] ifFalse: [fieldMap movePlG: keyPlG.]. fieldMap processColoredWall. (fieldMap calcCatched) ifTrue: [ fieldMap plR totalScore: fieldMap plR totalScore + fieldMap plR score. fieldMap plR score: 0. keyPlR := nil. fieldMap plB totalScore: fieldMap plB totalScore + fieldMap plB score. fieldMap plB score: 0. keyPlB := nil. fieldMap plG totalScore: fieldMap plG totalScore + fieldMap plG score. fieldMap plG score: 0. keyPlG := nil. "fieldMap startNewRound." "fieldMap draw." gameMenu startRound. "fieldMap draw." ^ ''. ]. fieldMap drawUpdates. Transcript show: 'round: '. Transcript show: fieldMap plR score. gameMenu setPoints: (fieldMap plR score) playerChar: 'r'. Transcript show: ' '. Transcript show: fieldMap plB score. gameMenu setPoints: (fieldMap plB score) playerChar: 'b'. Transcript show: ' '. Transcript show: fieldMap plG score. gameMenu setPoints: (fieldMap plG score) playerChar: 'g'. Transcript cr. Transcript show: 'total: '. Transcript show: fieldMap plR totalScore. "gameMenu setOverallPoints: (fieldMap plR score) playerChar: 'r'." Transcript show: ' '. Transcript show: fieldMap plB totalScore. "gameMenu setOverallPoints: (fieldMap plB score) playerChar: 'b'." Transcript show: ' '. Transcript show: fieldMap plG totalScore. "gameMenu setOverallPoints: (fieldMap plG score) playerChar: 'g'." Transcript cr. "fieldMap dump."! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:36' prior: 34470269! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap delete. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:36' prior: 34473995! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:37' prior: 34475053! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp delete. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:38' prior: 34476095! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! Morph subclass: #GameMenu instanceVariableNames: 'form map player rounds plrRPoints plrROverall plrGPoints plrGOverall plrBPoints plrBOverall fieldMap pacmanApp numRounds numPlayer restart' classVariableNames: '' poolDictionaries: '' category: 'Pacman-Gui'! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:39' prior: 34414425! initialize "comment stating purpose of message" super initialize. restart := false. Transcript show: 'initialize called'. form := self makeControlPanel. form openInWorld. ! ! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:39' prior: 34477156! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. (restart = true) ifTrue: [pacmanApp deleteMorph.]. restart := true. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! GameMenu new.! !GameMenu methodsFor: 'as yet unclassified' stamp: 'mr 6/29/2011 08:40' prior: 34478721! startGame "comment stating purpose of message" self setOverallPoints: 0 playerChar: 'r'. self setOverallPoints: 0 playerChar: 'g'. self setOverallPoints: 0 playerChar: 'b'. self setPoints: 0 playerChar: 'r'. self setPoints: 0 playerChar: 'g'. self setPoints: 0 playerChar: 'b'. Transcript show: '#####' , player contents. numPlayer := (player contents) asNumber. ((numPlayer < 1) | (numPlayer > 3)) ifTrue: [ self inform: 'invalid number of players'. ^ false. ]. numRounds := (rounds contents) asNumber. numRounds := numRounds - 1. (numRounds < 0) ifTrue: [ self finishGame .]. fieldMap := FieldMap new. fieldMap setGameMenu: self. (restart = true) ifTrue: [pacmanApp delete.]. restart := true. pacmanApp := PacmanApp new. (numPlayer < 3) ifTrue: [pacmanApp setBotPlB: true.]. (numPlayer < 2) ifTrue: [pacmanApp setBotPlG: true.]. "gameMenu := GameMenu new." pacmanApp setMap: fieldMap menu: self. self startPacmanApp: pacmanApp. fieldMap draw. ! ! GameMenu new.! ----QUIT----{29 June 2011 . 8:41:34 am} Squeak4.1.image priorSource: 917099! ----STARTUP----{29 June 2011 . 9:25:56 am} as /home/michael/Progs/Foop/temp2/foop/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Resources/Squeak4.1.image! GameMenu new.! ----QUIT----{29 June 2011 . 9:27:12 am} Squeak4.1.image priorSource: 926438! \ No newline at end of file | ||
