Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Sliding Tile Game
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
corriep




PostPosted: Sun Mar 08, 2009 3:27 pm   Post subject: Sliding Tile Game

Basic game I made, everyone has played one version or another of this game.

Instructions :
    The target image will show on the screen and it will start scrambling.
    Press the space-bar to stop it.
    Click on the tiles to swap them with the free space.

Have fun!



Sliding Tile.t
 Description:
Sliding Tile Game

Download
 Filename:  Sliding Tile.t
 Filesize:  5.29 KB
 Downloaded:  251 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
A.J




PostPosted: Sun Mar 08, 2009 4:53 pm   Post subject: Re: Sliding Tile Game

Do you mind providing us with the pictures also?
corriep




PostPosted: Sun Mar 08, 2009 4:56 pm   Post subject: Re: Sliding Tile Game

Ya that probably could have helped, heres the whole thing in zip file.

It works with any image at 400x400 pixels



Sliding Tile.zip
 Description:
Heres the program and the pic in a .zip

Download
 Filename:  Sliding Tile.zip
 Filesize:  32.21 KB
 Downloaded:  114 Time(s)

copthesaint




PostPosted: Sun Mar 08, 2009 7:07 pm   Post subject: RE:Sliding Tile Game

Error line 54/ White.Jpg is not created successfully Forgot to include the other picture too...
corriep




PostPosted: Sun Mar 08, 2009 7:18 pm   Post subject: Re: Sliding Tile Game

Ok I am a noob. 3rd times the charm? Confused

And that white.jpg was a completely blank image, the only reason I used it was for consistency and laziness!



Sliding Tile.zip
 Description:
Third times the charm!

Download
 Filename:  Sliding Tile.zip
 Filesize:  33.3 KB
 Downloaded:  171 Time(s)

A.J




PostPosted: Sun Mar 08, 2009 9:55 pm   Post subject: RE:Sliding Tile Game

Still doesn't work....line 54 Error

I think this doesn't work because your tile(i).pic wasn't initializes properly.....look into your initialize procedure and debug (i.e. output debug messages).


EDIT : I found your mistake. At line 41, the Pic.New command requires (a, b) to be the bottom left point of the picture, and (c, d) to be the top right point of the picture. Right now, (a, b) is the top left point and (c, d) is the bottom right point. And furthermore, you didn't calculate the coordinates of the tile(i) correctly. You want the 16 tile(i).x and tile(i).y to evenly split up the whole picture. For that, you have to make sure that you are splitting up the picture correctly. Output the 'x' and 'y' values of the tile(i) and check if they are splitting up the picture, or if the are out of bounds.


EDIT 2 : NEVERMIND!!! I got it to work. Just change what I said earlier (the (a, b, c, d) to (a, d, c, b)) and then change the dimension of the window to 401*401 instead of 400 * 400 in line 6. Since some of the tile(i).pic accesses the point on 400, you have to make the boundary 1 bigger. Cool program, I like it Very Happy
hossack




PostPosted: Wed Mar 11, 2009 7:57 am   Post subject: RE:Sliding Tile Game

This is a cool game
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: