im trying to make a turn based sidescroller and i want the player to be able to move the camera around without moving the mob. any advice on how can i do this?
|
how do i do that though? the only example i see is using
client/eye=locate(5,5,1) how do i move the eye left/right or up/down |
In response to Surge mage
|
|
Surge mage wrote:
how do i do that though? the only example i see is using Use animate() on ,client pixel_x and pixel_y. @Edited Try: mob/proc/MoveScreen(X,Y) |
Code:
mob/proc/movescreen(X,Y) Problem description: ok thanks now it just says error index list out of bounds |
Because i made mistake it is how should looks like
mob/proc/movescreen(X,Y) |
Code:
mob Problem description: cool is there a way to keep scrolling instead of stopping? i couldnt get it to happen ^ |
What do you mean? Could you give us more details about what do you want to do?
Maybe you want something like in MOBA or RTS games, so then i think the best way is build something like "camera control system" independent of players mob. Check http://www.byond.com/developer/forum_account/pixelmovement |
sure cant get the demo to load though says: error unable to open <forum_account\keyboard>
think of like 2dtanks games i want to be able to scroll around the entire map basiclly |
In response to Surge mage
|
|
Surge mage wrote:
sure cant get the demo to load though says: error unable to open <forum_account\keyboard> Delete this lib and download it again. If you will still have a problem, try to stop your antivirus. think of like 2dtanks games i want to be able to scroll around the entire map basiclly If you mean somethink like "Worms" series, just make a obj, focus client.eye on it and just move itas you like. |
Code:
mob Problem description:/b> well it didnt seem to work with the sidescroller library but with the pixel movement one im getting an error:key_down:undefined proc |
If you want control of the camera to be separate from the position of the mob, the best way to do it is to set the client.eye to a different mob than the player mob.
The problem with just animating the client pixel_x/y, is that it just shifts the viewport. It doesn't actually change the location of the viewport, so the edges of the viewport are still not expanding when the pixel values are moved too far. This will result in weirdness. It's better to use a different mob to control the camera. Here's an example of the above in effect: A very simple implementation of this could look something like this: mob |
simple to you lol
looks great but what do i put in the args i dont quite understand and can i just use 32 instead of tile_width/height |
and then you would modify the location/offset of the mob's eye as needed.