Games How do i set an animated background tiled and moving ?

droidman

Member
Licensed User
Hi, i'm making a simple game, i wanted the intro page to have a transpanrent png icon tiled and moving on X & Y axis like the old 16bit games had.
any code snippets out there?
thanks
 

ilan

Expert
Licensed User
Hi, i'm making a simple game, i wanted the intro page to have a transpanrent png icon tiled and moving on X & Y axis like the old 16bit games had.
any code snippets out there?
thanks
what libs are you using to create your game? simple canvas and timer? xui2d? libgdx? ispritekit? its better to give you the snipped for the tool you wanna use.
 

droidman

Member
Licensed User
what libs are you using to create your game? simple canvas and timer? xui2d? libgdx? ispritekit? its better to give you the snipped for the tool you wanna use.
Hi ilan thank you for the reply.
I said game but it is not like 2d/3d action or moving etc, it is like a quiz game. it asks people questions and gives many possible answers only one of them is correct, like a trivia game.
I'm starting it from scratch but maybe someone out there already made a sample code for something like this. Im trying to figure out how to allow people to connect from facebook in order to have their picture on the game and store their current score, it's like candy crush but for trivia, you just move forward to the next question as if it was a level. The background was purely black with white text so i thought it looked really bad, i have used xui2d on this project but not done anything with it yet.
 

ilan

Expert
Licensed User
said game but it is not like 2d/3d action or moving etc,
i understand that you are talking about a game but you need to understand that there are a lot of ways how to make games. for a game like yours i would use simple tools like timers and canvas or maybe views.

creating a moving background is very simple. you just draw a bitmap on canvas in different positions with a timer. or you put a big image view and move it with a timer. you can also create a parallax effect like this. i posted a long time ago a simple example on how to do that.

link: https://www.b4x.com/android/forum/threads/simple-parallax-scrolling-ispritekit.82989/
(this example uses ispritekit for ios but creating it for b4a is very simple)

btw check also this collection of free source that also includes full games in it: https://www.b4x.com/android/forum/threads/free-source-codes.53152/

(have a look at the clumsy bird example)
 

ilan

Expert
Licensed User
Do you know any example for facebook connect and storing user's scores?
i use google account in my apps to let users sign in by using firebase auth library. the setup is a little bit complex but after doing it once its much simpler.


there is also a possibility to use facebook for that just use the search function of the forum it is really working ;)

Edit: also available for facebook https://www.b4x.com/android/forum/threads/facebook-extends-firebaseauth-to-support-facebook.67954/#post-430482
 
Top