Tutorial 2. Profesores: Sergio Cuenca y Antonio Martínez Dept. Tecnología Informática y Computación Universidad de Alicante

Arquitecturas Reconfigurables Tutorial 2 Profesores: Sergio Cuenca y Antonio Martínez [email protected] Dept. Tecnología Informática y Computación U

6 downloads 44 Views 193KB Size

Recommend Stories


Universidad : ALICANTE
Universidad : ALICANTE Notas de Corte por Titulaciones y Cupos Título Deportistas Alto Nivel General Grado en Administración y Dirección de Empres

Plan de Acción Tutorial C.E.P.A. Antonio Machado
2015 2016 Plan de Acción Tutorial C.E.P.A. Antonio Machado ZAFRA INTRODUCCIÓN Para la elaboración del presente Plan de Acción Tutorial se han ten

Export Dept.:
collezioni IBB SPA IBB SPA is a Family Company recognized for the manufacture of Bathroom and Home decorative accessories. The Company is committed

Story Transcript

Arquitecturas Reconfigurables

Tutorial 2

Profesores: Sergio Cuenca y Antonio Martínez [email protected] Dept. Tecnología Informática y Computación Universidad de Alicante

1

1. Raqueta • Posición Vertical fija: PaddY = VisibleLines-24; (BallX,BallY)

(PaddlX,PaddY)

• Control de rebote bola-raqueta:

(BallX,BallY) BALL SIZE BALL_SIZE

(PaddlX,PaddY) PADD SIZEY PADD_SIZEY PADD_SIZEX

2

Raqueta: Dibujo macro proc Display(Video,GamePixel,BallX,BallY,PaddX,PaddY) InPaddX=(sx==0@PaddX)?1:((sx==0@(PaddX+PADD_SIZEX))?0:InPaddX); InPaddY=(sy==0@PaddY)?1:((sy==0@(PaddY+PADD_SIZEY))?0:InPaddY); if (Video.Visible==1) // if we're in the visible range { if (InBallX (InBallX==1 1 && InBallY==1) InBallY 1) // ball Verificar antes que {GamePixel = logo;} “main area” else if (InPaddX==1 && InPaddY==1 // paddle {GamePixel = Red;} else if (InAreaX==1 (InAreaX 1 && InAreaY==1) InAreaY 1) // main area {GamePixel = Cyan;} else // border {GamePixel = Red;} } else // In the blanking period {GamePixel = Black;}

3

Control de rebote bola-raqueta macro proc PerFrameUpdate() Rebote borde horizontal superior

if (BallY < (BORDER_WIDTH+SPEED) || (BallY > (PaddY-BALL_SIZE-SPEED) && (BallX > (PaddX-SPEED+SPEED_PAD) && BallX (PaddY-BALL_SIZE-SPEED) && (BallX > (PaddX-SPEED) && BallX0) Solo hay movimiento par sii quedan q ed n vidas id { BallX = dx ? BallX+SPEED : BallX-SPEED; BallY = dy ? BallY+SPEED : BallY-SPEED; } else par { BallX ll = VisibleCols/8; i ibl C l /8 BallY = isibleLines/2; init=0; }

10

Marcador macro proc PerFrameUpdate() //Cycle 4: Update the copy par(i=0;i

Get in touch

Social

© Copyright 2013 - 2024 MYDOKUMENT.COM - All rights reserved.