Readme questions

Moderator: tr1p1ea

Post Reply
wild8900
New Member
Posts: 35
Joined: Mon 19 Sep, 2005 11:26 pm

Readme questions

Post by wild8900 »

Hey, what does it mean by these? What does each setting do?
Spr_Method
Spr_UpdateLCD

Also, for the map drawer, how do you determine which number in a matrix is which tile?

Lastly I dont fully understand what these are:
ScreenStartX
ScreenEndX
ScreenStartY
ScreenEndY

Yes, I looked at the example that came with it :roll:
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Spr_Method: whether you want to draw the sprite directly to the screen (Overwrite)or invert the pixels you would otherwise draw (XOR)or only draw pixels where there allready is one AND there is on in the sprite at that place, or add your sprite to the screen (OR)

Spr_Update: update the LCD after the draw or not, it is best to update it at the last draw call to avoid flickering (ever done anything in OpenGL? this works a bit like it)

ScreenStartX: the X at which to start a tilemap - note that it is really that X * spritewidth, it lets you have an empty space at the left side of your map (you could display game statistics there forexample)
ScreenEndX: about the same, except it lets you leave space at the Right side of the screen
ScreenStartY: well you get the idea now, this leave space at the top.



shouldn't this be in the help section?
wild8900
New Member
Posts: 35
Joined: Mon 19 Sep, 2005 11:26 pm

Post by wild8900 »

Alright thanks, also, when I move the player, how should I draw it? Oh and how should I clear the spot that the player was last at? ATM I have it redraw the Map then the player over and over in a while loop. This sucks up speed badly.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

drawing the map using overwrite will cause the player sprite to disapear aswell, so first draw the map, then the player, and you won't need to clear anything
wild8900
New Member
Posts: 35
Joined: Mon 19 Sep, 2005 11:26 pm

Post by wild8900 »

Thats what I have atm, but doesnt redrawing the map everytime suck up the frame rate?
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Does you game scroll? If it just draws whole rooms, most people will draw the map to begin with and store it to a PIC. Then they will recall the pic at the start of the main loop which is a lot faster than calling the drawmap function again.

If the areas that the sprite can move in are always blank (white) you can just use XOR as your sprite method. Then to erase it you simply redraw the sprite over itself again.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
dysfunction
Calc Master
Posts: 1454
Joined: Wed 22 Dec, 2004 3:07 am
Location: Through the Aura

Post by dysfunction »

If your character sprite only moves over blank spaces, you can use either XOR or OR (you'll get the same result in that situation) to draw him, then XOR to erase him. If not, and you're using masking, you'll want to use AND logic to draw the mask, then OR or XOR (again they'll do the same thing here) the sprite on top of that; you'll want to have stored your map as a pic file right after rendering it, and then recall it to erase the character, or else you could redraw the single tile the character sprite is standing on, depending on your needs.
Image


"You're very clever, young man, but it's turtles all the way down!"
Post Reply