IGNORED

# The mystery of Monkey Moon ;)

## Recommended Posts

I'm glad you noticed it because it means you're squeezing the most from it.

Dz-Jay explanation is right.

I would simplify that each sprite has its own collision bits (COL0 for SPRITE 0, COL1 for SPRITE 1 and so on)

The mask for AND can be calculated easily as:

Bit 0 - value 1

Bit 1 - value 2

Bit 2 - value 4

Bit 3 - value 8

Bit 4 - value 16

Bit 5 - value 32

Bit 6 - value 64

Bit 7 - value 128

Bit 8 - value 256

If you want to check the collision against SPRITE 1 to 6 then you add 2+4+8+16+32+64 = 126 that is \$7e hexadecimal.

Check Appendix A for IntyBASIC reference on COL0-COL7 it contains most of this explanation except the value table.

Hope this helps.

##### Share on other sites

The "COLx" directives are actually internal variables returning the raw value of the STIC's collision register for a sprite (0 to 7).

The values represent a 8-bit "bit field" in which each bit says whether the sprite collided with an object or not: 0 means no, 1 means a collision.

In the Monkey Moon example, \$007e is the same as the binary value %01111110. That represents a collision with objects 1, 2, 3, 4, 5, and 6 (counting bits from the right side). Notice that the first bit on the right (for sprite 0) is not "on," and neither is the last one on the left (for sprite 7).

The "AND" operator "masks" the value returned by the COL0 variable using \$7E as the mask. The result is for it to return "true" if any of the masked bits (representing collisions with sprites 1 to 6) are "on," "false" otherwise.

(In case it is not obvious, "AND" is a "bitwise" operator which compares each bit on either side and turns them into a "1" of not are "1," or "0" otherwise. Thus, %1111 AND %0001 = %0001.)

If you wanted to check a collision between sprite #4 and sprite #0, you can try either:

(COL4 and \$01) ' %00000001

Or

(COL0 and \$10) ' %00010000

Does this make sense?

dZ.

Got it ... going right to left on the sprite count messed me up, but got it now! Thanks!

##### Share on other sites

Got it ... going right to left on the sprite count messed me up, but got it now! Thanks!

Take a look at the "Constants.bas" file in the SDK "lib" folder. I believe we defined friendly constants for the collision values.

To apply more than one, just add them together.

dZ.

P.S. I updated my previous post to fix some typos. It seems auto-correct likes to change my "bits" into "nots," completely altering the meaning of what I was trying to say!

##### Share on other sites

Yes, those constants are called HIT_SPRITE0, HIT_SPRITE1 to HIT_SPRITE7. As I'm too lazy to check, does the compiler optimise (COL4 AND HIT_SPRITE0) OR (COL4 AND HIT_SPRITE1) OR (COL4 AND HIT_SPRITE2) into (COL4 AND \$0007)?

##### Share on other sites

Yes, those constants are called HIT_SPRITE0, HIT_SPRITE1 to HIT_SPRITE7. As I'm too lazy to check, does the compiler optimise (COL4 AND HIT_SPRITE0) OR (COL4 AND HIT_SPRITE1) OR (COL4 AND HIT_SPRITE2) into (COL4 AND \$0007)?

No. Too complicated yet for the compiler.

##### Share on other sites

Fair enough. It means hexadecimal values (once the programmer has learned how they are constructed) are relevant even when the constants are there for abstraction.

##### Share on other sites

Yes, those constants are called HIT_SPRITE0, HIT_SPRITE1 to HIT_SPRITE7. As I'm too lazy to check, does the compiler optimise (COL4 AND HIT_SPRITE0) OR (COL4 AND HIT_SPRITE1) OR (COL4 AND HIT_SPRITE2) into (COL4 AND \$0007)?

No, but you could add them with the "+" operator and they will get resolved to a constant.

##### Share on other sites

Fair enough. It means hexadecimal values (once the programmer has learned how they are constructed) are relevant even when the constants are there for abstraction.

Not necessarily. Try:

(COL4 AND (HIT_SPRITE0+HIT_SPRITE1+HIT_SPRITE2))

That should work.

##### Share on other sites

D'oh!

I was looking for some || operator but completely forgot addition.

##### Share on other sites

D'oh!

I was looking for some || operator but completely forgot addition.

There is the OR operator. Also optimizes constants.

##### Share on other sites

D'oh!

I was looking for some || operator but completely forgot addition.

Note that it only works for bit fields because the values are non-overlapping powers of two (i.e. individual bits). That should cover all of the MOB register fields, though.

dZ.

##### Share on other sites

There is the OR operator. Also optimizes constants.

Ah! Good to know. I wasn't sure if it would, but it makes sense.

dZ.

##### Share on other sites

Question. Does This book just discuss the coding aspect, or is it truly for beginners, that is, does it walk one through downloading the necessary software and how to use that as well? I need the “for dummies” version.

##### Share on other sites

Question. Does This book just discuss the coding aspect, or is it truly for beginners, that is, does it walk one through downloading the necessary software and how to use that as well? I need the “for dummies” version.

It's for dummies it includes all the steps needed to download and install the required software.

We couldn't use the "for dummies" name because is trademarked, but it would have sounded great "Programming Intellivision games for dummies"

##### Share on other sites

This one perhaps would've been a tad too long: "All you ever wanted to know about programming Intellivision games, but were too afraid to ask"

##### Share on other sites

Question. Does This book just discuss the coding aspect, or is it truly for beginners, that is, does it walk one through downloading the necessary software and how to use that as well? I need the “for dummies” version.

The book is aimed at beginners. If you are a true beginner, may want to use the IntyBASIC SDK, which makes it even easier to use. For instance, it will install all the necessary tools in the right place for you, and combine the work of compilation and assemblage into a single step.

A new version for Windows with the latest compiler and other features will be released at the end of the month, but you can still get the current version and get started.

-dZ.

##### Share on other sites

This one perhaps would've been a tad too long: "All you ever wanted to know about programming Intellivision games, but were too afraid to ask"

Another very good option

##### Share on other sites

First, thanks to you both for helping keep the Inty alive. I assume it is a labor of love and not a get rich quick scheme.

It's for dummies it includes all the steps needed to download and install the required software.

We couldn't use the "for dummies" name because is trademarked, but it would have sounded great "Programming Intellivision games for dummies"

Thanks for the info. I definitely dont know command line, even though I use computers daily, so I would be looking for a step by step process to getting it started. Definitely have a game idea I would like to attempt at some point.

The book is aimed at beginners. If you are a true beginner, may want to use the IntyBASIC SDK, which makes it even easier to use. For instance, it will install all the necessary tools in the right place for you, and combine the work of compilation and assemblage into a single step.

A new version for Windows with the latest compiler and other features will be released at the end of the month, but you can still get the current version and get started.

-dZ.

Thanks. I imagine the two together would be a powerful Inty punch for a beginner. I originally held back waiting for the Mac version, since I dont have a Windows computer except my sons and he is too busy playing Fortnite to let me get on it. (Dont worry. He plays Inty with me too.) I saw on a different thread you said the Mac version may be near, so I will probably wait. Im in no rush. It is just a bucket list type thing for me to take a swing at. Edited by Sir Jay
##### Share on other sites

First, thanks to you both for helping keep the Inty alive. I assume it is a labor of love and not a get rich quick scheme.

Thanks for the info. I definitely dont know command line, even though I use computers daily, so I would be looking for a step by step process to getting it started. Definitely have a game idea I would like to attempt at some point.

Thanks. I imagine the two together would be a powerful Inty punch for a beginner. I originally held back waiting for the Mac version, since I dont have a Windows computer except my sons and he is too busy playing Fortnite to let me get on it. (Dont worry. He plays Inty with me too.) I saw on a different thread you said the Mac version may be near, so I will probably wait. Im in no rush. It is just a bucket list type thing for me to take a swing at.

Yeah, sorry about the delay, but I had trouble building the installer properly on a Mac. I plan on releasing the Mac SDK along with the latest version for Windows at the end of the month.

-dZ.

##### Share on other sites

Question. Does This book just discuss the coding aspect, or is it truly for beginners, that is, does it walk one through downloading the necessary software and how to use that as well? I need the “for dummies” version.

I'm a novice myself and I bought it. Occassionally, there has been an item or two that having a knowledge of simple basic helps but it has explained most things pretty well. I've only gotten through the first game (pong) and I've cobbled enough together to make a (somewhat pathetic) shooting game.

And, in my experience, any time I've not understood something or had a question, this community has been great in helping out those of us who are "programmatically challenged".

##### Share on other sites

• 1 month later...

Nice review of the book by The No Swear Gamer.

https://youtu.be/ZUgVKYVGWGo

##### Share on other sites

• 3 weeks later...

Great hands-on review by Gray Defender

https://youtu.be/MX6mbdoNCY4

##### Share on other sites

I found the hard cover version, cheap on the lulu site and finally bought a copy!

I don't know if you ship these out yourself, but if you do, please autograph my book for me.

##### Share on other sites

I found the hard cover version, cheap on the lulu site and finally bought a copy!

I don't know if you ship these out yourself, but if you do, please autograph my book for me.

It ships directly from a Lulu facility. But if you still want an autograph you can send it to me and I'll send it back, you'll need to pay \$10 for shipping (I'm including a new bubble envelope and Mexico postal mail has increased its charges this year)

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.