Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Can someone please explain this piece of code???

Author
Message
TLOZ
21
Years of Service
User Offline
Joined: 7th May 2005
Location: Enfield, NC
Posted: 19th Nov 2005 03:07
I've been trying to learn tiles for some time now, and I kind of understand them for the most part due to pizzaman's code, but can someone please explain what "mod" means in this line of code? Is it some kind of hidden command? What is it used for?

if SCREENSIZEX mod TileSizeX then TilesPerScreenX = TilesPerScreenX + 1

I've been using DBpro.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Nov 2005 07:03
Quote: "if SCREENSIZEX mod TileSizeX then TilesPerScreenX = TilesPerScreenX + 1"


It's a math thing.

Quote of the Darkbasic Help Files:
Quote: "The MOD specifies that the data on the left side of the MOD is to be divided by the data on the right side of the MOD, and the remainder of the division is the result:

11 MOD 2 equals 1
A MOD B equals the remainder of the division between A and B
"
TLOZ
21
Years of Service
User Offline
Joined: 7th May 2005
Location: Enfield, NC
Posted: 19th Nov 2005 20:41
Thanks

Login to post a reply

Server time is: 2026-07-07 00:31:08
Your offset time is: 2026-07-07 00:31:08