dmg@ssc-vax.UUCP (David Geary) (01/15/88)
First of all, let me thank all of you who responded to my original posting (Leo Schwab, Rob Peck, etc.) (One guy even CALLED me at work to help me out cause he didn't have access to USENET - thanks Charles). I am new to both USENET and programming on the Amiga, and it sure is great to get such awsome support from programming heavies in the Amiga community... (Aint USENET great?!?) Anyway, in article 1606, I wrote: >> I am in the process of developing my own version of Arkanoid... >> >> 2) How can I put shadows underneath the boxes, paddle and ball? ... >> I want the background to show through the shadows. I'd like shadows >> similar to the shadows that Dropshadows creates on workbench. In article 4972, Leo Schwab writes: > You should be able to get away with 8 colors on an arkanoid clone. > Open a 4-plane screen (16 colors), then make colors 8-15 dimmer versions > of colors 0-7. Then, when you want to render a shadow, set your > RastPort.Mask value to 0x08, and draw a slightly offset rectangle... I also got a response from Rob Peck suggesting that I use the ExtraHalfBright mode, but I decided against that because *I think* that all Amigas do not neccessarily have the ExtraHalfBright mode. Leo's suggestion sounds good to me except that I will have a pattern on the background that I want to show through. Should I copy a rectangle from the playfield into a buffer, set the RastPort.Mask to 0x08, and then render the rectangle I copied back on to the screen? Another consideration is that the shadows for the boxes can all be rendered with rectangles, but the baton's shadow is odd shaped. How do I deal with that? These *#$% shadows are really the only thing (besides lack of time) that is holding me back from getting this thing off the ground, so I'd really appreciate any responses I get from anyone out there in NetLand. One more thing. Due to a suggestion from Rob Peck, I have decided to make the ball a sprite. So, I wrote a *simple* game of pong - just the paddle, walls, and ball, with the ball a sprite. When the ball moves across the screen at what will be full-speed in my Arkanoid version, you can actually see 3 balls all the time, because the previous 2 renderings of the ball do not disappear completely before the next rendering is done. I don't get this one, because I can move the Intuition pointer around with the mouse, and it doesn't do the same thing. What can I do? Sprites are the ultimate, right? Is it my compiler? (I hope) I have Lattice 3.03. Anybody know of sprite-bugs with 3.03? Have you guys seen how FAST the ball moves in Arkanoid - and all without a hitch? Do I need to do something besides use sprites? This is really frustrating... Thanks for the help... /;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;/ /;; ;;/ /;; "...And the waitress is practicing politics ;;/ /;; as the business men slowly get stoned..." ;;/ /;; ;;/ /;; The Piano Man, By Billy Joel ;;/ /;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;/ -- *********************************************************** * David Geary, Boeing Aerospace Co., Seattle, WA * * (206)773-5249. --I disclaim everything I've ever said--* ***********************************************************
ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (01/20/88)
In article <1617@ssc-vax.UUCP> dmg@ssc-vax.UUCP (David Geary) writes: >In article 4972, Leo Schwab writes: >> You should be able to get away with 8 colors on an arkanoid clone. >> Open a 4-plane screen (16 colors), then make colors 8-15 dimmer versions >> of colors 0-7. Then, when you want to render a shadow, set your >> RastPort.Mask value to 0x08, and draw a slightly offset rectangle... > >Leo's suggestion sounds good to me except that I will have a pattern on >the background that I want to show through. Should I copy a rectangle >from the playfield into a buffer, set the RastPort.Mask to 0x08, and >then render the rectangle I copied back on to the screen? No. You'd do something like this: /* * Example assumes that colors 8-15 are dimmer versions of * colors 0-7. */ SetAPen (RastPort, 0xffL); /* Set all bits */ RastPort.Mask = 0x08; /* Set high bit */ /* Draw shadow over whatever's there. */ RectFill (RastPort, x1, y1, x2, y2); >Another consideration is that the shadows for the boxes can all be rendered >with rectangles, but the baton's shadow is odd shaped. How do I >deal with that? [ ... ] You'd OR all the bitplanes in the baton to create a single bitplane shadow mask. Then you'd blit it into the most significant bitplane in your playfield. Poof! _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ \_ -_ Recumbent Bikes: dual ---> !{well,unicom}!ewhac O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack") "Simplicity and clarity should be your theme in dress." -- A fortune cookie I got in LA's Atomic Cafe.
cmcmanis%pepper@Sun.COM (Chuck McManis) (01/21/88)
In article <5038@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: |> /* |> * Example assumes that colors 8-15 are dimmer versions of |> * colors 0-7. |> */ |> SetAPen (RastPort, 0xffL); /* Set all bits */ |> RastPort.Mask = 0x08; /* Set high bit */ |> /* Draw shadow over whatever's there. */ |> RectFill (RastPort, x1, y1, x2, y2); Just out of curiosity, has anyone tried opening a 4 bitplane window, and then creating two additional rastports one of which is a 3 plane, and one of which is a 1 plane? Then for background images you draw into the 3 plane rastport, and for shadow stuff you draw into the 1 plane rastport. Maybe setup Bobs for both and use them simultaneously? Just a thought, I'll have to try it out sometime. Also there is the TV*Text way of doing shadows. Basically you use a pattern fill, and fill a light dither of black into your background. Due to the way the eye perceives things the area will seem 'darker'. Try using the gadget ghosting pattern (which if I recall is 0x8888,0x2222). --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.
ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (01/24/88)
In article <39432@sun.uucp> cmcmanis@sun.UUCP (Chuck McManis) writes: >Just out of curiosity, has anyone tried opening a 4 bitplane window, >and then creating two additional rastports one of which is a 3 plane, >and one of which is a 1 plane? Then for background images you draw >into the 3 plane rastport, and for shadow stuff you draw into the >1 plane rastport. [ ... ] Yup, it's perfectly valid. In fact, I did it for a commercial program I wrote in early '86 (Typing Tutor plus Word Invaders). 1.1 had a bug in the ScrollRaster() call, in that it failed to observe the RastPort.Mask field correctly. So I set up a "bogus" RastPort that pointed to the plane I was interested in. Worked great. A neat side effect was that the programming got easier; I didn't have to do all sorts of fiddling around with a single RastPort's mask field. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ \_ -_ Recumbent Bikes: dual ---> !{well,unicom}!ewhac O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack") "Simplicity and clarity should be your theme in dress." -- A fortune cookie I got in LA's Atomic Cafe.