sprite coordinates for middle-left of screen

I am making a side scroller and need help getting the coordinates fir my sprite. i want the rocket to be on theleft side of the screen but in the middle on the left side
here’s my code so far:

-- Use this function to perform your initial setup
function setup()

-- This function gets called once every frame
function draw()


   -- for i = 1,40 do
 --      sprite("Small World:Tree Round Dark", xpos/4+ 25*i-100, 90,40,50) 
 --   end  
  --  for i = 1,20 do
  --     sprite("Cargo Bot:Title Large Crate 1", xpos/2+ 50*i-100, 60,60,70) 
 --   end
    for i = 1,10 do
        if grass[i]==1 then
            sprite("Tyrian Remastered:Space Ice 6", xpos+101*i-100, 0)
            sprite("Documents:Floor", xpos+101*i-100, 0)
    --need to reset xpos at an appropriate point to get wraparound


.@Kingamer - on the same discussion which you used as the basis for your code, there is a more complete example of a side scroller including a reasonable amount of internal comments:


In this example I set up two variables heroy and heroy to be the position of the hero sprite (or rocket in your case). I also assume that you are using the ipad in landscape mode.

Sprite("your rocket sprite here",herox,heroy,100,100)

To get the “rocket” to be on the left, I would set my herox variable to be something like 100 (in general the x positions run from 0 on the far left of the screen to 1024 on the far right, though once you get the hang of it you may want to look at the special WIDTH parameter which returns the width of the screen)

The same approach applies for the y position (or how far up the screen it is). So set heroy to be something between 0 (bottom of the screen) and 768 (top of the screen). 384 would be the middle. Similarly to above, the HEIGHT parameter may be useful in future for dealing with different screen sizes and orientations.