Project: ! Castle Game Author: Scratch: 1.3 (release of 2-Sep-08) Notes: a 2-player castle game where you must blow up the opponent's castle as many times as possible. With off-screen movement, realistic wind, realistic momentum, realistic aiming, nuclear cannonballs and a fully destructible environment. hold down the mouse to power up, release to fire. the cannon aims at your mouse. History: 2008-8-24 22:08:02 save ! Castle Game 2008-9-12 17:25:26 save ! Castle Game 2008-9-23 20:57:32 save ! Castle Game 2008-9-27 11:05:14 save ! Castle Game 2008-9-27 11:05:15 save ! Castle Game 2008-9-27 11:05:16 save ! Castle Game 2008-9-27 12:17:18 save ! Castle Game 2008-10-9 22:49:01 save ! Castle Game 2008-10-9 22:54:44 save ! Castle Game Totals: Sprites: 5 Stacks: 26 Unique costumes: 7 Unique sounds: 5 -------- Sprite: Stage Costumes (1): background1 (480x360) Sounds (1): pop (0:00:00) Stacks (2): when green flag clicked set "Player 1's score" to 0 set "Player 2's score" to 0 broadcast "restart" end when I receive "restart" set "start" to 0 hide variable "ball real y" hide variable "ball real x" hide variable "power" end -------- Sprite: cannon Costumes (1): costume1 (19x8) Sounds (0): Stacks (3): when I receive "restart" set "turn" to 1 forever if start2 = 1 and start = 1 if 1 = turn else go to "castle1" point towards "mouse-pointer" else go to "castle2" point towards "mouse-pointer" end when I receive "restart" set "turn" to 1 forever if start2 = 1 and start = 1 if mouse down? wait 0.5 secs if mouse down? show variable "power" broadcast "POWER UP" and wait hide variable "power" broadcast "fire!!" and wait end when I receive "POWER UP" set "power" to 0 repeat until power > 995 or not mouse down? change "power" by 5 end -------- Sprite: castle1 Costumes (1): costume1 (40x22) Sounds (1): pop (0:00:00) Stacks (1): when I receive "start" set "start" to 0 go to x: -220 y: 180 repeat until touching color c[205C00]? change y by -1 set "start" to 1 wait until touching color c[9C0000]? change "Player 2's score" by 1 broadcast "restart" end -------- Sprite: castle2 Costumes (1): costume1 (40x22) Sounds (1): pop (0:00:00) Stacks (1): when I receive "start" set "start2" to 0 go to x: 220 y: 180 repeat until touching color c[205C00]? change y by -1 set "start2" to 1 wait until touching color c[9C0000]? change "Player 1's score" by 1 broadcast "restart" end -------- Sprite: cannonball Costumes (3): costume2 (3x3) costume3 (75x75) costume4 (75x75) Sounds (1): pop (0:00:00) Stacks (2): when I receive "restart" switch to costume "costume2" set "wind" to pick random -3.001 to 3.001 end when I receive "fire!!" show variable "ball real y" show variable "ball real x" go to "cannon" set "ball real y" to y position set "ball real x" to x position point towards "mouse-pointer" set "ys" to "cos" of direction / 50 / power set "xs" to "sin" of direction / 50 / power repeat until touching color c[205C00]? or "abs" of ball real x > 300 or "abs" of ball real y < -180 if touching "edge"? else hide else show change "ball real y" by ys change "ball real x" by xs set y to ball real y set x to ball real x change "ys" by -0.1 set "xs" to xs + wind * 0.99 - wind set "ys" to ys * 0.99 switch to costume "costume3" if not touching "edge"? hide stamp wait 0.1 secs switch to costume "costume4" stamp switch to costume "costume2" hide variable "ball real y" hide variable "ball real x" if turn = 1 else set "turn" to 2 else set "turn" to 1 end -------- Sprite: painter Costumes (1): costume1 (3x3) Sounds (1): pop (0:00:00) Stacks (1): when I receive "restart" set "start" to 0 set "painter y" to pick random -150 to 100 go to x: -240 y: painter y point in direction 90 hide pen down set pen color to c[205C00] clear repeat 40 change x by 1 set y to -180 set y to painter y repeat 400 pen down change x by 1 change y by 1 * "cos" of direction change y by y position / -100 turn pick random -20 to 20 degrees set "painter y" to y position set y to -180 set y to painter y repeat 40 change x by 1 set y to -180 set y to painter y broadcast "start" end --------