Is it possible to make the screen keep moving like temple run game?

272 views
Skip to first unread message
Assigned to italob...@gmail.com by me

Wang Hui Juan

unread,
Aug 2, 2015, 8:51:59 PM8/2/15
to MIT App Inventor Forum
Is it possible to make the screen keep moving like temple run game, or subway surfer or keep the object keep moving forward?

Italo

unread,
Aug 2, 2015, 9:11:17 PM8/2/15
to mitappinv...@googlegroups.com
The best way to have an animated background is to create or find a SEAMLESS BACKGROUND IMAGE which means you can repeat it endlessly without noticing the beginning or the end. Something like this one http://fantendo.wikia.com/wiki/File:15859127-seamless-background-cartoon-summer-landscape-green-forest-and-blue-sky-with-white-clouds.jpg
The next step will be to use a paint software to move the background a fixed amount of pixels every time, for example if your background has 300 pixels wide, you can move it 20 pixels to the left, copy the part on the left that now is off the screen and paste it on the right, where you will have the empty space. Save it as "background1.png"
Move it another 20 pixels, copy and paste, like you did before and name it "background2.png", etc Until you get "background15.png"

Back in AI2, load all the 15 backgrounds as assets.
Create a CLOCK and every time the TIMER event is called, change the background image to the next image. When 15 is reached, start again from 1

I did something like that in this game. Stars move from top to bottom to simulate space travel. Let me know if you need more help.


Taifun

unread,
Aug 3, 2015, 9:28:47 AM8/3/15
to MIT App Inventor Forum
see also Scott's example here https://groups.google.com/d/msg/app-inventor-developers-library/BVETLCTSQtc/lk2iiCTfccYJ
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Reply all
Reply to author
Forward
0 new messages