Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DisplaySerial Serial
- #include <Picaso_Const4D.h>
- #include <Picaso_Serial_4DLib.h>
- Picaso_Serial_4DLib Display(&DisplaySerial); //Serial0 kommunikoi näytön kanssa.
- int kenttakoko[2] = {320,240};
- int pallo[2] = {20,(kenttakoko[1]/2)};
- int pikselikoko = 20;
- int seinanLeveys = 5;
- int mailaX = 5;
- int mailaY = 10;
- int pallonKoko = 7;
- int nopeus = 3;
- int pelaajaApisteet = 0;
- int pelaajaBpisteet = 0;
- int pelaajaApaikka = 0;
- int pelaajaBpaikka = 0;
- char palloSuuntaVaaka = 'R';
- char palloSuuntaPysty = 'S';
- boolean peliPyorii = true;
- void setup() {
- Display.TimeLimit4D = 5000 ; //Viiden sekunnin viive kaikkiin komentoihin.
- DisplaySerial.begin(9600) ;
- delay (5000); //Annetaan näytölle aikaa käynnistyä
- Display.gfx_ScreenMode(LANDSCAPE); //Laitetaan näyttö vaakatasoon.
- Display.gfx_Cls(); //Tyhjennetään näyttö.
- Display.gfx_RectangleFilled(5,90,15,140,WHITE); //Piirretään "mailat".
- Display.gfx_RectangleFilled(315,90,305,140,WHITE);
- }
- void palloPiirto(int x, int y) {
- Display.gfx_CircleFilled(x,y,pallonKoko,WHITE); //Piirretään pallo
- }
- void palloPoisto(int x, int y) {
- Display.gfx_CircleFilled(x,y,pallonKoko,BLACK); //Poistetaan pallo
- }
- void mailaA(int x, int y) {
- Display.gfx_RectangleFilled(x,y,
- }
- void loop()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement