Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Pong.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include "AsciiImagingLayer.h"
- #include "ScreenObject.h"
- #include "Paddle.h"
- #include "Ball.h"
- int _tmain(int argc, _TCHAR* argv[])
- {
- int scoreA;
- int scoreB;
- AsciiImagingLayer layer = AsciiImagingLayer();
- Paddle paddleA = Paddle(Vector2(0,0), Vector2(1,5), &layer);
- Paddle paddleB = Paddle(Vector2(60,0), Vector2(1,5), &layer);
- Ball ball = Ball(Vector2(40,40), Vector2(2,2), &layer);
- ScreenObject screenObjects[3] =
- {(ScreenObject)paddleA,
- (ScreenObject)paddleB,
- (ScreenObject)ball};
- while(true)
- {
- for(int i = 0; i < 3; i++)
- {
- screenObjects[i].Draw();
- }
- layer.Paint();
- break;
- }
- return 0;
- }
- //Header ----------------------------------------------------
- #pragma once
- #include "Vector2.h"
- #include "AsciiImagingLayer.h"
- class ScreenObject
- {
- public:
- ScreenObject(Vector2 position, Vector2 size, AsciiImagingLayer *layer);
- ScreenObject();
- ~ScreenObject(void);
- Vector2 Position();
- Vector2 Size();
- void Draw();
- void Update();
- void Collision(ScreenObject *collision);
- Vector2 _position;
- Vector2 _size;
- AsciiImagingLayer _layer;
- };
Advertisement
Add Comment
Please, Sign In to add comment