Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / image to matrix?

Author
Message
vivi
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 18th May 2003 00:09
can i load a 2D image picture and add collisions to it to only let the player move in certain areas you know like ff7? i wasn't 100% sure if this i a 3D question or 2D so dont curse about it

Thanks for any help provided
WHY WAIT FOR GAMES.......MAKE THEM COME TO YOU
>>>>www.sharksoft.scripterz.com<<<<<
THANKS IN ADVANCE
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th May 2003 02:13
This is just as much a 2D question as 3D.

Ok, for no-go areas, I'd probably create a 2D array and populate it with 0 for clear, and any other number for not clear.

Then when you move, convert your world coordinates into array coordinates and check that the array value at that position is zero. If not, you don't allow the move.

Doing it this way, also gives you the ability to use this array to place objects in your world (the non zero number can refer to an object type).

It can also give you a way for enemy AI to search for you, using A* for example, because they would use the same array as you for determining where they can move.

And when I say 2D array, you can substitute 'bitmap' if you wish. That would work in the same way, using POINT to detect object positions - but it would be slower.

Hope that helps
vivi
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 26th May 2003 17:29
@.@.....Thanks.
I will not lie to you i dont know how to

"convert your world coordinates into array coordinates"

what do i have to do?

SharkSOFT- Newcommers Group
Email Me At Final_Equinox@msn.com
For A Newsletter
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th May 2003 20:52
could we see some code ianm i think i've got it working but the collision code is wrong and i think its quite a long way of doing it, anyways, one side of the matrix has been coded to have collision(the left side from your starting position) walk towards it and one tile before the edge you will stop... and then won't be able to move anymore


someone fix it please this would help me loads

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 30th May 2003 11:55
anyone???

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th May 2003 15:33
I'll have a look at giving you some example code sometime this weekend ... it'll plug nicely into my new sooper-dooper A* code that I'll be giving out once I've got a few awkward bits sorted
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 30th May 2003 20:57
thanks!!!

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!

Login to post a reply

Server time is: 2024-03-29 15:15:40
Your offset time is: 2024-03-29 15:15:40