as you can see i had remove the up down left right button away then add in the accelerometer to check the current status to trigger the function.
Base on what we discuss one creating two different speed i create a condition to check that if the data received from accelerometer is less than 3 it will be normal speed then if the data is more than 3 then will trigger the function that all the ship to move faster.
so i had create two different kind of left and two different kinds of right. left2 and right2 is the one trigger the faster speed.
so as i had explain in the accelerometer part one, when the game received the data from the socket they will check on what data had been received and trigger different function.
the ship will move base on the function that been called. for the faster speed i just basic x2 on the normal speed to make it move faster.
No comments:
Post a Comment