Old code discussion

I’m not sure if @Ignatz is still very active but i was wondering if anyone knew how to fix this old code I’m very confused by it.
https://gist.github.com/dermotbalson/ae776c7b74cb3bf2e70e

@chrislightsaber - could you give us a hint of what sctually happened when you run this and what you have used it on?

I’m on iPad and it gives me these two errors

@chrislightsaber - couple of things.

  1. Judging by your error you have loaded the code into one project tab. Not your fault, I copied and tried to load and sort the code into the separate tabs in the original but the extended press on new project didn’t work so I had to post into one tab like you. @Simeon please note.
    Not to worry - select all your code and copy, then press on the new project button until you get the paste new project button then give the new project another name.

  2. Now you will see all the code in separate tabs, easier to debug. Run it and you get the same error but now pointing to the tab name and line number. Tracing this error it refers to a spritesheet download in MapData tab line 15 which you need to download and store in your Dropbox or your Documents assets the amend line 14 to reflect that.

Try that out and see how you go.

Alright thanks I will try it soon

So I’m kinda confused where to get the sprite sheet download. Also I’m aging an issue at main when calling update multihandler

Ok I’m an idiot I found the sprite sheet download

Alright these are the new errors ghat appear

@chrislightsaber Where did you find the sprite sheet. When I have time later I’ll load the sprite sheet and see what happens.

Here ya go @dave1707
http://photobucket.com/gallery/user/ignatz_mouse/media/cGF0aDovVDFfenBzbnczeWV3Z3cucG5n/?ref=

@chrislightsaber The error you’re getting is because the y value for spriteSheet: copy (1185) is greater than the size of the sprite sheet (1024). I’m not sure the sprite sheet you’re using is the correct one for the program.

@chrislightsaber I got it to work using the sprite pointed to by the line of code in the tab MapData, T2.spriteURL. That should be a sprite sheet that’s 1024 x 1024 pixels. I then had to change the code in tab MapData, T2.images to

 T2.images={
    --sky={0,0,2000,500,2048/2000},
    --block={611,1701,294,300,0.0166},
    --surface={1,1401,599,600,0.02},
    --fence={1,880,511,511,0.01},
    jump={610,1390,300,300,0.05},
    --revolver={530,1185,200,190}
    surface={0,715,300,300,.02},
    revolver={271,606,100,100},
    block={313,870,150,150,.0166},
    fence={0,450,260,260,.01},
    sky={318,718,142,142,1024/1000}
}

To run the code, I just used Single Player. I didn’t try the other options.

EDIT: The values that I use in T2.images aren’t exact. They may be off by a few pixels so the overall images might be off a little.

I didn’t change the jump values because I didn’t know what it was for. After playing the game, I found inside the building was an area that once your on it, it takes you up a level on the building. So I’m not sure if I have the correct values corresponding to the table names.

@chrislightsaber Forget about the T2.images that I show above. Use these instead. I’m just integer dividing the coordinates by 2. The original sprite sheet was probably 2048 x 2048 pixels, but the sprite sheet size I was using is 1024 x 1024 pixels. With the new coordinates, everything looks a lot better.

T2.images={
    sky={0,0,2000//2,500//2,2048/2000},
    block={611//2,1701//2,294//2,300//2,0.0166},
    surface={1//2,1401//2,599//2,600//2,0.02},
    fence={1//2,880//2,511//2,511//2,0.01},
    jump={610//2,1390//2,300//2,300//2,0.05},
    revolver={530//2,1185//2,200//2,190//2}
}

@dave1707 - just picked up my pad, loaded the image up to check dimensions then switched to the forum - I had the same idea as you, thought Ignatz was using a retina image so planned to remap the sprites. Then found you had already been there and done it. Tried out on a single user, never seen this before. No collision detection so walking through walls is interesting. Now to test it with two pads.

@Bri_G I couldn’t walk thru any walls. When I walked straight at a wall, it flickered like I was going thru walls, but when I backed up, I was still at the first wall.

@dave1707— yup you are right. I think the mistake I took for walking thru walls was bouncing back then approaching again and bouncing back etc. Also going round corners seemed to cut off the corner. Got the hang of it and ended up on the roof. Not tested the multiplayer yet.