Problem description:
How do I move an object a set number of pixels?
How do I set an object to pixel-based coordinates?
#1 Jul 24 2012, 5:11 pm
|
|
Learn about Forum_account's libraries. Pixel Movement of Sidescroller, depending on your area of interest.
| |
I'm using built-in pixel movement. I don't want to use his libs.
| |
#3 Jul 24 2012, 5:14 pm
|
|
Look up pixel_x, pixel_y on the reference. Or you know, use a library and save yourself the headache.
| |
Albro takes full credit for this NOT ME. Cloud Magic banned him from posting so he asked me to post on his behalf. HE TAKES FULL CREDIT
ALBRO1 SAYS: You can move an object a certain number of pixels by modifying it's
| ||||
#6 Jul 24 2012, 5:18 pm
|
|
Movement in general is a visual offset combined with appropriate-looking collision detection. Also, Forum_account's libraries use use built-in pixel movement and greatly improve on them. It'll definitely save yourself a lot of trouble using an established set of tools designed to help you out, instead of trying to piece together a decent-looking system from scratch.
| |
Trouble is my middle name!
Nah but really... most of forum_account's libraries have many features in them that I wouldn't use. It bothers me to have phantom code sitting there taking up space. My pet peeve about those libs is that he chose to place Isometric and 2D pixel movement together in one library. While I could mod them...it wouldn't be worth my time, I'd rather live and learn. | |
#8 Jul 24 2012, 5:33 pm
|
|
I don't really understand what taking up space means, you have infinite space, it's all virtual. If you mean say, taking up possible variable names or proc names, well you wouldn't want to use variable names or proc names that are claimed by a popular library anyway.
| |
The cool thing about preprocessors like #define and #if is that, if you're using TWO_DIMENSIONAL mode, none of the 3D code is actually read by the compiler. It's literally skipped over.
Also, it's better to have something you don't need now than not have it when you do. Could you explain more about the things the library provides that you don't need? | |
#10 Jul 24 2012, 10:53 pm
|
|
Well, when I changed all of my bound_width and bound_height to pwidth and pheight, and included his library, my screen is black upon login. If I modify my set_pos and actually get it to run without dreamseeker crashing, my movement is all buggy and crazy.
| |
#11 Jul 27 2012, 9:26 am
|
|
My pet peeve about those libs is that he chose to place Isometric and 2D pixel movement together in one library. That's because there's no difference between isometric movement and 2D movement. Isometric is just how the objects are displayed on the screen. The map is still a 2D grid of turfs and you can move in the x and y directions. There are only three lines of code in the library that are specific to isometric maps and they're only there because of how icon sizes are handled in isometric mode. | |