Game Programing

Moderators: odroid, mdrjr

Game Programing

Unread postby agent6 » Mon Sep 24, 2018 6:36 am

I had a TicTacToe game that I programed for an Arduboy. I wanted to port it over to the odroid go. Two things I am having problems with....

1) The screen flickers really bad.... I looks like each time I clear the screen it is one frame the I redraw is another. for pixels flicker on and off.
I did fix this by only clearing the screen on key press but that is not optimal.....
Is there a better way to blit to the screen?????

2) What is the format for drawBitmap???? My bitmap is not compatible with odroid-go.. ie this is my "X"

const unsigned char select[] PROGMEM = {
0x00, 0x00, 0x3c, 0x4, 0x4, 0x4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4, 0x4, 0x4, 0x3c, 0x00, 0x00, 0x00, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x78, 0x00,
};

and it comes out as scrambled dots.....
agent6
 
Posts: 3
Joined: Thu Jun 28, 2018 2:19 pm
languages_spoken: english
ODROIDs: odroid-go

Re: Game Programing

Unread postby agent6 » Mon Sep 24, 2018 6:40 am

agent6
 
Posts: 3
Joined: Thu Jun 28, 2018 2:19 pm
languages_spoken: english
ODROIDs: odroid-go

Re: Game Programing

Unread postby JoshS » Sun Dec 02, 2018 10:16 am

I haven't even started yet, but I would guess that you should NEVER clear the screen, only draw completed screens to it.
In other words you need a backing store, don't write straight to the screen, only dump competed buffers to it.

I also have a chess game and an othello game I've run on arduinos before that I'll try to port to odroid some day.
JoshS
 
Posts: 17
Joined: Fri Nov 23, 2018 8:15 pm
languages_spoken: english
ODROIDs: Odroid go

Re: Game Programing

Unread postby konig » Tue Dec 04, 2018 7:47 am

1) Try setting up the clear so that it only effects the regions that need redrawing rather than clearing the whole screen

2) The bitmap format is 16 bit RGB565 indicating 5 bits for Red, 6 for Green, and 5 for Blue. You can convert other image formats to it using the open source software GIMP with the following: File-> Export As -> Select "C Source code" for the export type and in the next window, ensure the box is checked for "Save as RGB565 (16-bit)"
konig
 
Posts: 21
Joined: Thu Aug 16, 2018 11:09 pm
languages_spoken: english
ODROIDs: GO


Return to Arduino Coding Camp

Who is online

Users browsing this forum: No registered users and 3 guests