The Daily Click ::. Forums ::. Klik Coding Help ::. Snap To Grid MMF
 

Post Reply  Post Oekaki 
 

Posted By Message

Red Crystal



Registered
  18/08/2003
Points
  53
19th August, 2003 at 15:58:11 -

Hi all,
I am a re-registered user to the daily click community. Unfortunately I had to re-format my PC and lost EVERYTHING + forgot all my passwords (except hotmail).
Anyway, I had a HEAP of tutorials, including one on making a SNAP-TO grid for clickable objects in multimedia fusion, unfortunately, I lost that and cannot remember where I got it...

Here is what I hope to do:

1) Create a WORLD MAP EDITOR for my game before I actually make the game. Ie. use the editor to make maps for the game, then make the game and load maps made with editor into it...

2) I have made all of my objects / tiles for the editor. Tha main thing stopping me now is a good 'clickable' interface. I would be very grateful if someone could help me with the following:

a) how to create a snap-to grid.

b) how to change objects via mouseclick: eg. you've finished tiling grass and want to select the water tiling tool.

c) how to actually go about saving created maps made with the editor.

I know many of you may be able to help with A and B and I realise C is alot more difficult than A and B, but if you can help at all then I would be muchos thankful.

Thanks in advance!

 
"Lol, Classic Ashman" © Me 2002

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
19th August, 2003 at 18:03:16 -

Behold the marvellous glory of www.create-games.com/sendpass.asp . Horray.

a) You can set the X position of the objects to Floor ( X position / 32 ) * 32, where 32 is the object width. Same for the Y positions.

b) I can't explain this, there's lots of methods.

c) Try looking into the INI or Array objects. You'll need some practice, but eventually you'll get the hang.


 
gone fishin'

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
20th August, 2003 at 02:27:26 -

B - Well once you have learnt to do C (see below) then in the array slots you can save differant numbers for differant tiles. What you need is a counter and then when you click with the right mouse button add one to that counter. Until it gets to a certain value (total number of differant tile types) when it resets to 0. You also need an active cursor that has every differant tile you will need the rest is to do with arrays so here is some Code:

Right mouse pressed - counter = counter + 1

counter = 10 - counter = 0

always set cursor.dir to counter.val

Left mouse pressed - (Array) Save value at current x,y - (Counter.value), create tile at mouse.x,y tile.dir = counter.value

I forgot to add that you will need a "Blank tile" which shows what is at that grid spot. Because when you add the data to the array that there is something there, you won't be able to see it on the screen. I also left out the setting array x,y because you'll need to look up arrays.

C - Too long to explain, and example would help better. But the array is the best way to go about it so find some tuts on it.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
20th August, 2003 at 04:01:14 -

Instead of the */ method, just use the MOD function. It's a lot simpler. I might upload an example later.

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert

Red Crystal



Registered
  18/08/2003
Points
  53
20th August, 2003 at 10:19:00 -

Thanks alot! It all seems clearer now, I will try out the suggested methods when I have time and read up on INI and arrays. Thank you all.

 
"Lol, Classic Ashman" © Me 2002
   

Post Reply



 



Advertisement

Worth A Click