Side scrolling morph for platform gamesRe: Gaming paper advice sought

Ned Konz ned at bike-nomad.com
Sat Aug 23 14:34:35 UTC 2003


On Saturday 23 August 2003 06:04 am, Karl Ramberg wrote:
> Anybody made a side scrolling morph for platform games ?
> And tiled platforms ?

You can just use a PasteUpMorph (or other container) inside a 
TransformMorph.

Try this for fun from a Workspace:

box _ BorderedMorph new
	layoutPolicy: ProportionalLayout new;
	bounds: (100 at 100 corner: 500 at 500);
	color: Color blue muchLighter.
box openInWorld.
t _ TransformMorph new.
box addMorph: t fullFrame: (LayoutFrame fractions: (0 at 0 corner: 1 at 1) 
offsets: (0 at 30 corner: 0 at 0)).
playfield _ PasteUpMorph new
	vResizing: #spaceFill;
	color: Color white;
	extent: 1000 at 400.
t addMorph: playfield.
playfield addMorph: (Morph new position: 100 at 100).
playfield addMorph: (Morph new color: Color red; position: 500 at 150).
playfield addMorph: (Morph new color: Color red; position: 950 at 250).

p _ [ [ WorldState addDeferredUIMessage: [ t offset: ((t offset + 
(10 at 0)) \\ (playfield width - box width)) ].
	(Delay forMilliseconds: 100) wait. ] repeat ] forkAt: Processor 
userBackgroundPriority.

"later"
p terminate.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list