05.03.2013 Views

Amiga Computing - Commodore Is Awesome

Amiga Computing - Commodore Is Awesome

Amiga Computing - Commodore Is Awesome

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

his month's programs were sent by BL<br />

Gaunt - I wish people would send their<br />

first names, it's much more personal.<br />

Actually. they ate called procedures or PROCs, as<br />

that's what they are, and is such they can be<br />

bolted onto any program The PROCs are<br />

Shadowtext and Typewriter. the latter being a<br />

better version of the program included with Amos<br />

Pro. Both programs work in Arnos Pro and AMOS<br />

1.3.<br />

To start off well look at the Typewriter PROC.<br />

The code is good because it makes a noise if there<br />

is a letter to type, and if there is a space It remains<br />

silent, The sample provided is the sound of a<br />

typewriter key, which could, of course be<br />

replaced by the sound of a computer keyboard if<br />

you want to be a bit more modem The font<br />

could also be changed to make It a useful special<br />

effect for science fiction films. The proper usage of<br />

the PROC<br />

where XI' equals the location on the screen, S is<br />

the speed the text is typed at, and TS is a string of<br />

text to be typed.<br />

First off the initialise screen line is:<br />

1111<br />

6.<br />

and then a sample tol<br />

S<br />

-<br />

c r<br />

e<br />

4<br />

e n Illoor<br />

O1<br />

. 1 1 . 1 1 1 . 8 Dint 3<br />

pThis<br />

refers to the sample of a typewriter key being<br />

ehit,<br />

which you must load into bank 3 by hand<br />

n before you start coding - it will then be saved<br />

1<br />

with<br />

,<br />

the program. Finatty, before we get into the<br />

e<br />

routine<br />

4<br />

you turn off all the screen Junk:<br />

2 3<br />

6 .<br />

1 .<br />

ese Oil: Paper 1 : Curs Oil: Kid.: cts 411<br />

1 1<br />

r e<br />

s<br />

Stioalooksiot by S<br />

.L<br />

i9 li<br />

-<br />

14<br />

19<br />

W<br />

e<br />

e r<br />

,<br />

'<br />

y<br />

o<br />

u<br />

r<br />

d<br />

r<br />

e<br />

give you a nice has relief effect.<br />

a<br />

m<br />

c<br />

a<br />

m<br />

'<br />

, like this that you come up with.<br />

k<br />

r<br />

.<br />

o<br />

e<br />

•<br />

Remake,<br />

remodel<br />

This now means we are starting with a clean<br />

sheet of paper.<br />

The text to be typed is fed into the<br />

procedure. as are the other attributes•<br />

_tTPINIITEIC10,10,1,1o0 Typewriter effect<br />

aces. to sore eked to ale 8 due thicket.<br />

1<br />

km<br />

TIPSWIITEIC1,12,1,<br />

Key : Welt Key : idle<br />

. -<br />

The<br />

ith tou<br />

clear<br />

w<br />

and<br />

e<br />

wart are included to make sure<br />

the<br />

s s<br />

finished<br />

e e s<br />

text can be seen before the<br />

oprogram<br />

t o ends<br />

u hThe procedure e Itself <strong>Is</strong> very simple<br />

n e- o l<br />

Procedatt<br />

d l<br />

t<br />

oFirstly,<br />

set up the length Of the text in your<br />

oMing<br />

in characters using the LEN function<br />

.<br />

-P<br />

i l l<br />

IF<br />

O P<br />

Then usirig the RightS lure nun grail trie firSt<br />

t i -<br />

character in the string:<br />

O<br />

T<br />

o t<br />

Lh Check<br />

i<br />

for spaces tn me text, and if any are<br />

o i ( i<br />

found you don't play the sound<br />

S t )<br />

I TISTOiscatftiteS,1)) , .<br />

t If USW? Teee Sas PIey<br />

T<br />

1<br />

O<br />

1<br />

Next use Locate and print string to the<br />

. green:<br />

1<br />

1<br />

1<br />

1<br />

1<br />

III/1/1 1 Locate Led I I,T : Primt toftS01,1) 1<br />

Ming me Inc command to move along to the<br />

next letter Finally. insert a small wait command<br />

to delay the characters as they type onto the<br />

screen:<br />

Lurking in the shadows<br />

This <strong>Is</strong> an interesting routine, nicely coded and you could expand on it in a number of<br />

ways. For example, create a white drop shadow with no letters la very trendy text<br />

effect' by making the colour of the letters the same as your background, and making<br />

the colour of the shadow white or at least a lighter tone of the same colour. Another<br />

Idea would be to make two shadows, one brighter and one darker than the text, and<br />

make the text the same colour as the background. Then offset the lighter coksur up<br />

and left of the text, and the darker colour to the right and below the text. This will<br />

Text effects are cheap in processing time and easy to create, as long as you are<br />

creative with the way you display them. You can also animate the effects with a bit of<br />

judkious coding - for example, you could fade up the has relief effect to make it look<br />

as though the text is emerging from the surface. Id be interested to see any effects<br />

Wait P<br />

Nit I<br />

And that's it Quick and easy, and a rather good<br />

effect If I was using it for a film effect Id add a<br />

random element to the pauses between frames.<br />

just a little, to simulate the way people type<br />

Now ro move on to Shadowtese. This creates<br />

drop shadows on the text on screen. and its a nice<br />

routine which adds a little bit of pizzazz to game<br />

programs and any sort of mulurnecka The proper<br />

usage of the PROC is<br />

where xy Text position, SC Shadow colour. IC<br />

Text colour, and of course IS.Your text suing.<br />

Firstly, round up the usual suspects:<br />

Screen Opep 0,320,256,4,Lowrel<br />

Flask Off<br />

Curs Off : Hide On : Cts 0 : Oaf:<br />

111111<br />

111111<br />

to set up the screen. Then we can feed 11the<br />

data to<br />

the PROC:<br />

.514OOSTM(75,100,1,2,1kedowtest by 1.1.61<br />

! SMAINVICIIC10,130,1,2,4MOS-P10 veer, your<br />

;Imes cos. true.1<br />

their Key : Waft Key : lilt<br />

This is the same ending as before, with a clear and<br />

wait so you can see the effect. Now we define the<br />

PROC<br />

11111<br />

1<br />

The first thing we do in the PROC is to enable JAM<br />

Pr<br />

mode via the Gr Writing command<br />

oc<br />

ed<br />

ur<br />

6r iritiog 0 M I R O -<br />

e<br />

Next we set op a loop<br />

j e<br />

l l<br />

For An To 1<br />

O<br />

Ink St<br />

O<br />

S T<br />

If 1181<br />

EBy Ichanging<br />

the vaiues of X and Y you can increase<br />

Tthe Cdepth<br />

and direction of the shadow:<br />

W ,<br />

SI<br />

M<br />

C ,<br />

I l a 0 t 3 : Te r-1 : I nk TC<br />

1The Cendlif<br />

and the Text command end the loop and<br />

,<br />

IP<br />

print T the text to the screen<br />

1 . ]<br />

led If<br />

test 3,7,11<br />

lest i<br />

Ind hoc<br />

and it returrri for more, if there rs more. Knot it<br />

ends the PROC, returning you to the main program<br />

<strong>Amiga</strong> <strong>Computing</strong><br />

MAY 1995<br />

Phil South<br />

turns his<br />

atention to a<br />

[ontribution<br />

sent in IN an<br />

add Amos Ian<br />

Write<br />

stuff<br />

If you have an Amos<br />

question, or a routine<br />

you'd like to share I<br />

with the work', then<br />

please write to Phil<br />

South, Amos Column,<br />

<strong>Amiga</strong> <strong>Computing</strong>.<br />

Media House,<br />

Adhngton Park,<br />

Macclesfield SKR/ 4NP<br />

Please send routines<br />

on an <strong>Amiga</strong> disk with<br />

notes on how the<br />

program works on<br />

paper. Make the<br />

routines short (use<br />

these routines as a<br />

guide] and reasonably<br />

independent of any<br />

graphics and sound<br />

support files. although<br />

I will make provision<br />

for these if necessary<br />

•<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!