CODINGLISTINGS ★ Sound and Fury ★

Sound - Sound And Fury (The Amstrad User)Coding Listings
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

A Demonstration from Peter Campbell

The program takes up the theme of simulating animation through sequential colour changing and applies it to an explosion, accompanied by an appropriate sound. However, he program is probably of more interest because of the way n which symmetry is used to draw the circles. All routines used are labelled with explanatory headings, The first sets the initial values for the variables used. The second draws the circles. Note how lines 180-210 plot several points simultaneously. The third changes the colour in all pens (except number 1) to black so that the colours can be rotated by the fourth routine. The final routine generates the sound. Note the use of DN SQ(2) GOSUB to replenish the sound channel. The sound is called by RELEASE 2 in line 360 and kept in synchronization by the loop containing the variable 'waits'.

How It Works:

  • Lines 10-110: Set up the initial values of the variables used.
  • Lines 120-220: Draw a series of 15 concentric circles.
  • Lines 230-240: Change the colour of inks 2 to 15 to black.
  • Lines 250-350: Rotate the ink colours to create the illusion of animation.
  • Line 360: Releases the sound and synchronizes it with the action.
  • Lines 370-380: Ends the program when "en is hit
  • Lines 400-440: Generate the sound. Note that the subroutine is only called if there is a vacancy in the sound queue.
Variables Used:
  • a-b Variables which convert the expressions r(adius)*sin(j) and r(adius)*cos(j) to a form that can be used to plot eight points at the same time.
  • i-j Control variables, "i" is used for ink colour, "j" for the angle being plotted.
  • s String variable used in detecting if "e" has been pressed,
  • x-y Randomly generated values used in ink colour rotation.

The Amstrad User

★ PUBLISHER: The Amstrad User (Australia)
★ YEAR: 1985
★ AUTHOR: Peter Campbell
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Aucun fichier de disponible:
» Vous avez des fichiers que nous ne possédons pas concernent cette page ?
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Coding Src's » Up Scroll (Popular Computing Weekly)
» Coding Src's » Rotating Polygons (Computing with the Amstrad)
» Coding Src's » Sierpinski Fern (Amstrad Computer User)
» Coding Src's » Tauschen (CPC Amstrad International)
» Coding Src's » Graphic - Christmas Card (Popular Computing Weekly)
» Coding Src's » SUB TIMER: Digital Realtime Clock (CPC Amstrad International)
Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 165 millisecondes et consultée 1434 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.