Archived

This topic is now archived and is closed to further replies.

PlutoWarrior

Two Questions

Recommended Posts

I am making a 2D space game. I wanted to know how to know when to put other objects into the game at the right moments since the background is just one continously repeating bitmap. Should I make some sort of map file to keep track of the objects I want to add to the map? Or should I count the number of times the background repeats? My second question is how to have the screen move in a realistic way. The way I have it now is so that when the user presses the up key the background scrolls forward, when he presses back the background goes in the opposite direction. How can I get it to simulate different degrees of diagonal motion? [edited by - PlutoWarrior on July 26, 2003 4:37:11 PM]

Share this post


Link to post
Share on other sites
i think that if u divide the map into sectors u can calculate the sector where is the player and when the player approach other sector,u move the background (i'm not english and it's hard to explain in english,for me).to put the objects on the right moment u can set points on the map with links to an object (use pointers) and load the object only when the point is on screen.

can u understandmy explaination?because my english is so bad... :| sorry,i tried

Object Position
_______________
|.~~~~,~~~~~|
|..~~~,~,~~~~~|
|..~~~~~~~~~|
|...~,~,~~O~~~|
|.,~~~~~~~~~|
|_____________|

. = Water
, = Trees
O = Player
~ = Nothing

u can write ur map file in ASCII and tell to the compiler what are the Texture Background and after,u can draw the objects and apply some effects (like water effects) and draw only when they are on screen

-----------------------------
Sectors
___________________
|SSSSSSSSSSSSSSSSS|
|SSSSSSSSSSSSSSSSS|
|SS~~~~~~~~~~~SS|
|SS~~~O~~~~~~~SS|
|SS~~~~~~~~~~~SS|
|SSSSSSSSSSSSSSSSS|
|SSSSSSSSSSSSSSSSS|
-------------------
S = Sector change
O = Player
~ = Nothing

when the player toutch the Sector Change,then u move the map to the position u want and make other Sector Changes.

now,the map,have 3 skins.

_,,,^Ó..ò^,,,_

[edited by - KosmiC_Khaoz on July 27, 2003 1:41:46 AM]

[edited by - KosmiC_Khaoz on July 27, 2003 1:43:07 AM]

Share this post


Link to post
Share on other sites