|
-
Apr 28th, 2003, 07:10 AM
#1
Thread Starter
Fanatic Member
Move Image in restricted field
Hi,
I have map and a player (I am reffering to bitblt game which i have posted earlier in this forum)
I want the user to be restricted from running over water etc etc.
Could anybody pop up some idea's.
Thanks,
Pradeep
-
Apr 28th, 2003, 08:48 AM
#2
PowerPoster
Sorry I didn't watch your post but here's the theory:
In your map (or in the tiles) store a value Walkable (or Collision if you prefer) and when moving the player check the target position if it's allowed to walk there. If the player position is in pixel you have to divide it to get the map position, something like this:
VB Code:
If Tile( Map( player.x / 16, player.y / 16 ) ).Collision then
'Reject movement
Endif
Btw: Thanks for remembering me, I'll write a tutorial about this when I'm done with the tiles one.
-
Apr 28th, 2003, 08:51 AM
#3
Thread Starter
Fanatic Member
Hae Thankx
Well my game has a static background..
Well i found an example by cyborg in this forum.. I have done a map editor.. i am now redesigning the game..
Thankx..
Let me know once your article is ready..
-
Apr 29th, 2003, 08:38 AM
#4
Thread Starter
Fanatic Member
Hi
Fox,
I have made a tile game as you mentioned in yesterdays thread..
I am not loading the BMPs at runtime..
This is what i have done..
Create a Map using my own editor
and save it as a whole BMP also save a txt file with the tile numbers..
Map
+------+------+------+
| | | |
| 5 | 1 | 2 |
+------+------+------+
| | | |
| 3 | 6 | 5 |
+------+------+------+
| | | |
| 6 | 1 | 8 |
+------+------+------+
Txt file
5
1
2
3
6
5
6
1
8
Where the numbers corresponds to the tile numbers..
Now i load this file in my game and the background still
remains static.
I know the restrictions for my users and thus my game goes..
find it at
Here
I will read your tutorial now.. It looks very Good..
-
Apr 29th, 2003, 11:30 AM
#5
PowerPoster
You're not suppose to save the map as a bitmap... and about saving the files, I'll update the site today and add another tutorial showing you how to save/load binary files. Well keep reading anyways, it shows you how to implement a virtual camera you can move around your map and even how to animate tiles.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|