how would i got about this!?

okay i got a sprite that i want to move from left to right or right to left on screen...it should spawn on either side randomly and stay on the same x postion the entire time its on the screen...how would i go about it would something like this work?
and would i have to give it a movement speed?
1
2
3
4
5
6
if(SpriteBluex = 100 && SpriteBluey >= 0)
   SpriteBlueSpeedx = 1 && SpriteBlueSpeedy = 1

that should move it?
and then all i need to do is make it spawn on a either the left of the right of the screen randomly 
     
I'm sorry, my friend. What you wrote is not C++, or let's say, it's pointless. Please explain in more details what you wanna achieve.
Topic archived. No new replies allowed.