ID:270973
Nov 24 2006, 10:36 pm
|
|
Basically what I want to do is create an underwater combat system for my game. I have already gotten players to the underwater map, added a breathing system, and got them to switch states, but what I couldn't do is make them slowly descend in the water if they don't swim with arrow keys. Is there a way to make them descend by pixels? Also, I'd like to thank the people in this forum. In the last month of coding I've learned a lot from all of your posts and replies.
|
Copyright © 2024 BYOND Software.
All rights reserved.
In that case, if n was 100, your icon would move 100 pixels to the right. If n was -50, it would move 50 pixels to the left. One thing to note though is that this is purely graphical. So your real atom would still be in the same position (and Bump(), Enter(), density etc) would all work from the real position rather than the icon.
Similarly
If n was 5, you'd move 5 pixels up. If n was -94, you'd move -94 pixels down.
Another thing to note is that pixel_x and pixel_y only take real integers (real whole numbers). So 5.5 wouldn't work.
At this point, you might be loving pixel_x and pixel_y, but here's the real downfall. They range from -127 to 127, which means that you can't easily displace your icon more than 127 pixels. Search the forum for ways around that.