Centering uneven maps

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
paul
Posts: 457
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Centering uneven maps

Post by paul »

hello all,

Hoping someone can give me some insight on the best way to circumvent my problem before I go changing a bunch of art assets.

The main map for my game is 19x22. This doesn't center very well unless I offset it by 4 pixels. If I offset it by 4 pixels, my tile count jumps significantly because many of the re-used tiles are now incompatible. I also lose some convenient calculations, but that is not such a big deal. If I make it 20x22, it just doesn't look as good. What's the best way to resolve this issue?

So far I have put a conditional on the SCREEN_TILES_H define and defined it as 29 in the makefile's kernel options. I'm not sure if an uneven SCREEN_TILES_H count is something I need to avoid. I am only able to test on the emulator, currently (which is amazing - thank you, David!), and it doesn't seem bothered. But if I do it this way, my game cannot be linked to the main kernel. I also don't want a bunch of redefinition warnings.

The emulator has an option to adjust the left edge lock - is this an emulator-specific function or can I do similar in code? I've assumed the former, so far.

Any other suggestions? I just made this big ol' couch but it won't fit through the doorway :lol:
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: Centering uneven maps

Post by Jhysaun »

What video mode are you using?



>J
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
User avatar
uze6666
Site Admin
Posts: 4803
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Centering uneven maps

Post by uze6666 »

Forgot to answer this one. If you are using mode 1,3 or 4, add a define to your makefile:

Code: Select all

KERNEL_OPTIONS = -DUZEBOX -DVIDEO_MODE=1 -DINTRO_LOGO=0 -DCENTER_ADJUSTMENT=10
The valid value usually range from +10/-10 (depends on the video mode though). Note that this applies if you are use the beta-v4 branch code. For the trunk, if I recall you got to add the define it in the project's option dialog.

Uze
User avatar
paul
Posts: 457
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: Centering uneven maps

Post by paul »

Using video mode 3. I'm glad for the simple fix.

Thank you!
Post Reply