Hi,
For this project I won't consider colisions, with .top I will make that player can't move out of the road only, then, the game is based on increases/decreases of speed to beat a big number of rivals with different random events as stamina, energy consumption etc.. which affects the speed of players and rivals.
Final solution has been:
In active_create event I loaded the three parts of the road:
imagefondo.Bitmap = LoadBitmap (File.DirAssets, "road/roadholland_1_0_7499.png")
imagefondo.left = 0dip
imagefondo.top = 0dip
imagefondo.width = 4850dip
imagefondo.Height = 450dip
imagefondo2.Bitmap = LoadBitmap (File.DirAssets, "road/roadholland_2_7500_14999.png")
imagefondo2.left = 4850dip
imagefondo2.top = 0dip
imagefondo2.width = 4850dip
imagefondo2.Height = 450dip
imagefondo3.Bitmap = LoadBitmap (File.DirAssets, "road/roadholland_3_15000_22499.png")
imagefondo3.left = 9700dip
imagefondo3.top = 0dip
imagefondo3.width = 4850dip
imagefondo3.Height = 450dip
On timer tick:
ImageVehicle.Left = ImageVehicle.Left + 2dip
imagefondo.Left = imagefondo.Left - 2dip
imagefondo2.Left = imagefondo2.Left - 2dip
imagefondo3.Left = imagefondo3.Left - 2dip
I found two issues doing this, Please, if someone can guide me about how to solve:
(1) I have establish 4850dip in imagefondo,imagefondo2,imagefondo3 to fit with 7499px parts with test and error method in avd device but it's not still exact
. How can I set the exact measure in dips to fit with 7499px?
(2) Testing in an avd with 3,7 inches all is working fine, but same apk in my real device of 5,5 inches, vehicle finish exactly at the middle of the road when timer_tick changes to enable=false. I mean distance that vehicle completes in 5'5inch real device is exactly the half than it does in 3,7inchs avd device. I have tried different ways to solve it but I'm not sure why happens
Two points to consider:
- In Activity script I've set:
AutoScaleAll
- All images (imagefondo,imagefondo2,imagefondo3 and imagevehicle) are contained in a Panel in the activity not directly in the activity form)
Thanks & Regards