GuessNext: complete Flash game with highscores

Time to publish the complete tutorial about the making of GuessNext, a simple card game with highscores.

GuessNext

In order to make an highscore, you must register to Kongregate but you can play even if you don’t register.

It’s not meant to be a good or enjoyable game, it’s simply a programming exercise, so don’t expect the best game ever played before.

Anyway, it’s a good start for developing a complete and interesting card game.

The aim of the game is very simple: from a deck of 52 cards, you have to guess if each card is higher or lower than the previous one. That’s it.

Before we start talking about actionscript, a little information about the graphics.

This is the background

GuessNext

It was made with Photoshop selecting two green colors, one lighter than another, and using a clouds filter. Then, I give the result a light noise filter and the green background was done. The cards on the bottom left side are the same used in the game with a semi-transparent Soft Light blending.

The font is the Death Font you can find on dafont.com at this page.

Now, let’s go with the all-in-one-frame actionscript, just 172 lines to make a complete game Read more

Using BitmapData to manage a deck of cards – part 2

After a couple of days, the prototype for the management of a card deck is almost complete.

Now I have a full game, you draw a card and have to say if the next card will be higher or lower.

At the moment the prototype has all messages and a game over screen with the score recap.

Now I want to include Kongregate's highscores API and then I'll release the complete tutorial.

Meanwhile, here it is the code:

ACTIONSCRIPT:
  1. import flash.display.BitmapData;
  2. import flash.geom.Rectangle;
  3. import flash.geom.Point;
  4. import flash.filters.DropShadowFilter;
  5. import flash.filters.GlowFilter;
  6. var card_shadow:DropShadowFilter = new DropShadowFilter(4, 45, 0x000000, .5, 4, 4, 1, 3, false, false, false);
  7. var text_glow:GlowFilter = new GlowFilter(0x000000, .6, 4, 4, 2, 3, false, false);
  8. big_picture = BitmapData.loadBitmap("cardz");
  9. _root.attachMovie("table", "table", _root.getNextHighestDepth());
  10. _root.createEmptyMovieClip("game", _root.getNextHighestDepth());
  11. game.attachMovie("higher", "higher", game.getNextHighestDepth());
  12. game.attachMovie("lower", "lower", game.getNextHighestDepth());
  13. game.createEmptyMovieClip("big_pic_obj", game.getNextHighestDepth());
  14. big_pic_obj.attachBitmap(big_picture, game.getNextHighestDepth());
  15. big_pic_obj._visible = false;
  16. sequence = new Array();
  17. Array.prototype.shuffle = function() {
  18.     for (x=0; x<52; x++) {
  19.         var from = Math.floor(Math.random()*52);
  20.         var to = this[x];
  21.         this[x] = this[from];
  22.         this[from] = to;
  23.     }
  24. };
  25. for (x=0; x<52; x++) {
  26.     card = game.createEmptyMovieClip("small_pic_obj_"+x, game.getNextHighestDepth());
  27.     sequence[x] = x;
  28.     small_picture = new BitmapData(79, 123);
  29.     card.attachBitmap(small_picture, game.getNextHighestDepth());
  30.     small_picture.copyPixels(big_picture, new Rectangle(0+(x%13)*79, 0+Math.floor(x/13)*123, 79, 123), new Point(0, 0));
  31.     card._visible = false;
  32.     card.filters = new Array(card_shadow);
  33.     card.onEnterFrame = function() {
  34.         switch (this.action) {
  35.         case "come" :
  36.             this._x += 40;
  37.             if (this._x>210) {
  38.                 this._x = 210;
  39.                 this.action = "stay";
  40.                 if (cards_drawn>1) {
  41.                     game.ok_ko._visible = true;
  42.                 }
  43.             }
  44.             break;
  45.         case "move" :
  46.             this._x += 20;
  47.             if (this._x>310) {
  48.                 this._x = 310;
  49.                 this.action = "dissolve";
  50.             }
  51.             break;
  52.         case "dissolve" :
  53.             this._alpha -= 4;
  54.             game.lap_score._alpha -= 4;
  55.             if (this._alpha<0) {
  56.                 can_draw = true;
  57.                 game.ok_ko._visible = false;
  58.                 if (cards_drawn == 52) {
  59.                     endgame();
  60.                 }
  61.                 this.removeMovieClip();
  62.             }
  63.             break;
  64.         }
  65.     };
  66. }
  67. game.attachMovie("ok_ko", "ok_ko", game.getNextHighestDepth(), {_x:250, _y:230, _visible:false});
  68. game.attachMovie("score", "score", game.getNextHighestDepth(), {_x:0, _y:140});
  69. game.attachMovie("lap_score", "lap_score", game.getNextHighestDepth(), {_x:-50, _y:0, _alpha:0});
  70. game.score.filters = new Array(text_glow);
  71. game.lap_score.filters = new Array(text_glow);
  72. sequence.shuffle();
  73. cards_drawn = 0;
  74. points = 0;
  75. can_draw = true;
  76. draw_card();
  77. game.higher.onRelease = function() {
  78.     if (can_draw) {
  79.         can_draw = false;
  80.         higher = true;
  81.         draw_card();
  82.     }
  83. };
  84. game.lower.onRelease = function() {
  85.     if (can_draw) {
  86.         can_draw = false;
  87.         higher = false;
  88.         draw_card();
  89.     }
  90. };
  91. function draw_card() {
  92.     game.ok_ko.gotoAndStop(2);
  93.     lap = 0;
  94.     if (((sequence[cards_drawn]%13)<=(sequence[cards_drawn-1]%13) and (!higher)) or ((sequence[cards_drawn]%13)>=(sequence[cards_drawn-1]%13) and (higher))) {
  95.         game.ok_ko.gotoAndStop(1);
  96.         game.lap_score.lap_text.textColor = 0x40ff40;
  97.         if (cards_drawn>0) {
  98.             if (!higher) {
  99.                 lap = 13-(sequence[cards_drawn-1]%13);
  100.             } else {
  101.                 lap = sequence[cards_drawn-1]%13+1;
  102.             }
  103.         }
  104.     } else {
  105.         lap = -5;
  106.         game.lap_score.lap_text.textColor = 0x900000;
  107.     }
  108.     game.lap_score.lap_text.text = lap;
  109.     if (cards_drawn>0) {
  110.         game.lap_score._alpha = 100;
  111.     }
  112.     points += lap;
  113.     game["small_pic_obj_"+sequence[cards_drawn]]._x = 0;
  114.     game["small_pic_obj_"+sequence[cards_drawn]]._y = 10;
  115.     game["small_pic_obj_"+sequence[cards_drawn]]._visible = true;
  116.     game["small_pic_obj_"+sequence[cards_drawn]].action = "come";
  117.     game["small_pic_obj_"+sequence[cards_drawn-1]].action = "move";
  118.     cards_drawn++;
  119.     game.score.textscore.text = "Cards left: "+(52-cards_drawn)+" - Score: "+points;
  120. }
  121. function endgame() {
  122.     game.removeMovieClip();
  123.     _root.attachMovie("game_over","game_over",_root.getNextHighestDepth());
  124.     game_over.gameovertext.filters = new Array(text_glow);
  125.     _root.game_over.gameovertext.text = "Your score:\n"+points;
  126. }

and this is the result Read more

Using BitmapData to manage a deck of cards

December 28th update: 2nd part online

I have already published a tutorial about BitmapData in the post Shuffle an image with BitmapData, but this time I want to show you how to manage a deck of cards using BitmapData.

Managing a deck of cards is very useful because there are tons of card games you can publish once you have a deck of cards in your library.

The first thing you need is an image with all cards like this one:

Deck of cards

The image is scaled down for blogging reasons, but you can view/download it at its original size here.

Now, with the same method seen in Shuffle an image with BitmapData, I'll cut off all cards starting from the original image.

I am publishing some raw actionscript because this is just a prototype, but a full tutorial will come shortly.

The prototype is about the simplest card game ever: you draw a card and have to say if the next card will be higher on lower than the card you have on the table.

Being a prototype it's not complete yet, but I want to share this code to you. Read more

Most popular MochiAds games

Do you want to know how popular is your game compared to other MochiAds allowed games?

Do you want to know how many game are hosted on MochiAds?

Here it is the full answer:

  1. Bloons (play)
  2. Fifty Five - Paris (play)
  3. Thug (play)
  4. Ultrablock w/ Scores (play)
  5. Bloons Tower Defense 2 (play)
  6. Paris oh Paris (play)
  7. Choose Your Weapon (play)
  8. Anti-Pacman (play)
  9. Pinch Hitter 2 (play)
  10. MAD (play)
  11. FlashFlashRevolution (play)
  12. Forklift Frenzy (play)
  13. Colorz (play)
  14. Santa Caught Christmas (play)
  15. Bloons Tower Defense (play)
  16. More Bloons (play)
  17. Flash Element TD (play)
  18. Road (play)
  19. Desert Rally (play)
  20. Alphabet Jungle (play)
  21. Top Chef (play)
  22. The Last Dinosaur (play)
  23. Desktop Tower Defense (play)
  24. Cyborg (play)
  25. Blobbit Push (play)
  26. Bike Challenge (play)
  27. Sola Rola (play)
  28. City Smasher (play)
  29. Bloons Player Pack 1 (play)
  30. puzzlefreak (play)
  31. Ragdoll Laser Dodge (play)
  32. Cow Bandits (play)
  33. Castle wars (play)
  34. battlefieldgeneral (play)
  35. Shadow Factory (play)
  36. Onslaught (play)
  37. Extreme Heli Boarding (play)
  38. Butt Scan (play)
  39. Bloons Player Pack 2 (play)
  40. The Economist (play)
  41. B29 Assault (play)
  42. Xmas Corner (play)
  43. Towertown Tower Defense (play)
  44. Polar Boar (play)
  45. Japanese Jello (play)
  46. Army of Destruction (play)
  47. Angular Momentum (play)
  48. revenge of the stick (play)
  49. Santa's Gift Jump (play)
  50. Hotcorn (play)
  51. Hive Hero (play)
  52. Foods Stack (play)
  53. Boomshine (play)
  54. ~TimedHouse~ (play)
  55. Shape Wars (play)
  56. Santa Drop (play)
  57. Onslaught 2.1 (play)
  58. Elevatorz (play)
  59. ConFusebox (play)
  60. street rally (play)
  61. Smiley Puzzle (play)
  62. N3wton (play)
  63. Lynx Bike (play)
  64. Link Five (play)
  65. Weirdville (play)
  66. Retroid (play)
  67. One Ton Bang Bang (play)
  68. Headless Havoc (play)
  69. Flash Empires (play)
  70. Car Can Racing (play)
  71. Beetlewars (play)
  72. ant move (play)
  73. Heist (play)
  74. super b (play)
  75. The Cave Master (play)
  76. Starship Ranger 2 (play)
  77. connect it (play)
  78. Timebot (play)
  79. Potion Panic (play)
  80. Penguin (play)
  81. Magic Touch (play)
  82. Gravitee (play)
  83. Factory Balls (play)
  84. Sugar Free Super Hero: Christmas Time (play)
  85. Snowflake Rumble (play)
  86. Rodent Tree Jump (play)
  87. Phantom Mansion (green) (play)
  88. Jumping Jack (play)
  89. FireFlies (play)
  90. Quad Squad 2 (play)
  91. Pimp my Face (play)
  92. Matrix Rampage (play)
  93. London Cabbie (play)
  94. Flash Empires 2: Christmas Invasion (play)
  95. Escape #3: The Phonebooth (play)
  96. Caravaneer (play)
  97. The Waitress (play)
  98. The Gem Digger (play)
  99. Smiley Memory (play)
  100. Santa's Cubes (play)
  101. Rebound (play)
  102. Knight Tactics (play)
  103. Angel Bobble V1.04 (play)
  104. Training Micromonk (play)
  105. Tank 2007 (play)
  106. Pootris (play)
  107. Monster Truck Trials (play)
  108. Head defence (play)
  109. Generic Defense Game (play)
  110. Extreme Sketch-Pak (play)
  111. Crazy mammoths (play)
  112. Barnyard Balloon (play)
  113. Touch The Bubbles 2 (play)
  114. Super M (play)
  115. Fly Guy (play)
  116. Zeba (play)
  117. Space Bounty (play)
  118. Orbox B (play)
  119. Moolga (play)
  120. Golf Jam (play)
  121. Gamma Bros (play)
  122. tomb chess (play)
  123. Turtle Odyssey 2 (play)
  124. Throw Me (play)
  125. Sudoku Challenge (play)
  126. Santa Delivery (play)
  127. Rainbow Block (play)
  128. Pathfinder (play)
  129. Flash RPG Tower Defense (play)
  130. Flash Cricket 2 (play)
  131. Tabuto (play)
  132. Mahjong-Animal-Connect (play)
  133. Golf Drive (play)
  134. Evil Nights (play)
  135. mr. MothBall 3: snowy flakes (play)
  136. math mountain (play)
  137. aquva_buble (play)
  138. Replay Racer 2 (play)
  139. Puppet Melee (play)
  140. Punk (play)
  141. Hidden Zombie (play)
  142. Defender (play)
  143. Daymare Town (play)
  144. Collateral Damages II (play)
  145. ButtonHunt (play)
  146. Word Frenzy (play)
  147. So Whats the Difference?? (play)
  148. Crazy Fishing Online (play)
  149. Bungee Rescue (play)
  150. Another Box of Hotcorn (play)
  151. Turkey Bowl (play)
  152. Shield Defense (play)
  153. Nobuzzle Tree (play)
  154. Mindfields 2204 (play)
  155. Alex Trax (play)
  156. Touch The Bubbles (play)
  157. The Game Called Bob (play)
  158. Storm 1.1 (play)
  159. Soldiers' Defense (play)
  160. Save Me 2 (play)
  161. Santa's Cannon (play)
  162. One Ton Gorilla Warfare (play)
  163. Merlin's Christmas (play)
  164. Kebab Van (play)
  165. Castle Draw (play)
  166. littlefatninja (play)
  167. Super Sneaky Spy Guy 17 - Ghostly Pirates (play)
  168. Super Sneaky Spy Guy 16 ~ Sneaky goes to space (play)
  169. Straight Dice (play)
  170. Starfighter: Disputed Galaxy (play)
  171. Squid Swimmer (play)
  172. Race For The White House (play)
  173. Quick Catch! (play)
  174. Kitten Cannon (play)
  175. Keyboard Kaos (play)
  176. HeliStorm (play)
  177. Fifty Five - Vienna (play)
  178. Sproing! (play)
  179. Snake Classic (play)
  180. RoboPogo (play)
  181. Laser & Bubbles (play)
  182. Halloween Ride (play)
  183. Flying Fish (play)
  184. Enigmatica (play)
  185. Cursor Run (play)
  186. Bubbles (play)
  187. Brick!3 (play)
  188. save me (play)
  189. muttskis ping pong (play)
  190. Linebacker Alley (play)
  191. Jelly Blocks (play)
  192. Fellowship of Kings (play)
  193. Cubical (play)
  194. Chudadi Beauties (play)
  195. Turtle (play)
  196. Sprite Smash (play)
  197. Math Attack (play)
  198. Fat Fish (play)
  199. Dodge Fishy (play)
  200. Crystalloid (play)
  201. Circlo 2 (play)
  202. Shopping Mania (play)
  203. Raptek Arena (play)
  204. President War (play)
  205. Phantom Mansion (yellow) (play)
  206. Paris Hilton Jail Escape (play)
  207. Meltdown (play)
  208. MadPac3 (play)
  209. Boulder Basher 2 (play)
  210. Tetrical (play)
  211. Replay Racer (play)
  212. Red Team (play)
  213. Putt It In! The Garden Park (play)
  214. Don't Let Go 2 (play)
  215. Circle Chain (play)
  216. Wordelicious (play)
  217. The Pencil Farm Game Builder (play)
  218. The Mahjong (play)
  219. Temple Guardian (play)
  220. Squid Evader (play)
  221. Rings (play)
  222. Pojuko v1.0 (play)
  223. Poise (play)
  224. Piu Piu (play)
  225. Oroboros (play)
  226. Crystal Caverns (play)
  227. Cirplosion (play)
  228. Volley Spheres v2 (play)
  229. UFO Commando (play)
  230. The Sneaks (play)
  231. Book of Mages: The Chaotic Period (play)
  232. Save Me 3 (play)
  233. Flag Football (play)
  234. Dots (play)
  235. Babycal Throw (play)
  236. Azul Baronis (play)
  237. mr. MothBall 2: cotton carnage (play)
  238. flying string defense (play)
  239. blobuloids (play)
  240. Hong Kong Cat (play)
  241. Cubix (play)
  242. Cubex (play)
  243. Witch Hunt: Nooboo Mary (play)
  244. Wild Evader (play)
  245. Toxic Blocks (play)
  246. Susan Dress Up (play)
  247. Gold Mine (play)
  248. Dogfight (play)
  249. Bionic Bugz (play)
  250. The Pilot's Peril (play)
  251. Skyscraper Defense (play)
  252. Shanghai Firefly (play)
  253. Secret Agent (play)
  254. Ederon (play)
  255. Bomber Santa (play)
  256. the return (play)
  257. starling golf (play)
  258. We Are Legend (play)
  259. Speed Squid (play)
  260. Snow (play)
  261. Puppy Bash: webcam game (play)
  262. Docking Perfection (play)
  263. Cool Balls (play)
  264. Block Bash (play)
  265. Agyta (play)
  266. The Hunter (play)
  267. Rigby (play)
  268. Radioactive Snakes from Mars (play)
  269. Pacco (play)
  270. IndianFashion (play)
  271. Indian (play)
  272. Ghoulish (play)
  273. Elv is Black : Bunny Capture (play)
  274. Turret Pong (play)
  275. Shatter (play)
  276. Paperplane Madness 2 (play)
  277. Bod World (play)
  278. Base Jumping (play)
  279. Virus (play)
  280. SABERMAN! (play)
  281. Juggle Trouble (play)
  282. Helix Defense Minor (play)
  283. Gravity Pods (play)
  284. Capsules (play)
  285. Bubble (play)
  286. Big Joes Homerun Challenge (play)
  287. Balls! (play)
  288. Bacteria (play)
  289. 8bitrocket Retro Blaster! (play)
  290. Wild Mirror (play)
  291. Turbo Spirit (play)
  292. RomZom (play)
  293. Glowmonkey Skateboarding (play)
  294. Ghost Town (play)
  295. Bumper Car Madness (play)
  296. Asteroid's Revenge - Man Strikes Back v2.1 (play)
  297. Word Attack (play)
  298. Tophat Villa (play)
  299. Santa Dance (play)
  300. Rball+ (play)
  301. Purp (play)
  302. Orbital (play)
  303. Flashpipes (play)
  304. Escape From Hartwell (play)
  305. Doom (play)
  306. Control (play)
  307. Colour Connect (play)
  308. Celtic Village (play)
  309. Brain Bones (play)
  310. Need For Extreme Online (play)
  311. Kistibi (play)
  312. Click Fest 2 (play)
  313. Blue (play)
  314. BeatBox 1 (play)
  315. ASUE1 : The Horse (play)
  316. Target Shooter Firing Range (play)
  317. Shen Long (play)
  318. Paintball (play)
  319. Deep Sea Dive (play)
  320. Cube Crash (play)
  321. Breakout (play)
  322. Biggification (play)
  323. Aqua Bubble (play)
  324. SQUAREball (play)
  325. Mole Hunter (play)
  326. Fields Of Logic (play)
  327. Christmas Couples (play)
  328. Wack O Wack (play)
  329. REAKTOR (play)
  330. PileOBubbles (play)
  331. Masterfisher (play)
  332. Instant Flowers (play)
  333. Floating Shooter (play)
  334. Delta Fusion (play)
  335. Chafed[yo] (play)
  336. The Ultimate Gamer Quiz: Xbox 360 (play)
  337. Glowmonkey Vs The Meltdown (play)
  338. Farming Life (play)
  339. Stickman Sniper (play)
  340. Portal v1.0 (play)
  341. Dodgeball (play)
  342. UltraSports Archery (play)
  343. Star Pumper v1.0 (play)
  344. O Cofre (play)
  345. My Jigsaw (play)
  346. Global Defense (play)
  347. Crimson Planet (play)
  348. Big Fish (play)
  349. Animal Dance (play)
  350. Sycolux (play)
  351. Nutty McNuts (play)
  352. Mobile Weapon Assault (play)
  353. Attackers Three-Sixty (play)
  354. Western Shoot (play)
  355. Space Invaders (play)
  356. Samurai Defense (play)
  357. Rotospheres (play)
  358. Panda Bowling (play)
  359. Falldown (play)
  360. Shred Master (play)
  361. From Space with Love (play)
  362. Equilibrated Willy (play)
  363. A Sticks Quest (play)
  364. Merlin's Christmas 2 (play)
  365. Elite Base Jump (play)
  366. bubble pop 2.0 (play)
  367. Twice as Bounce (play)
  368. Tileball (play)
  369. Little worm (play)
  370. Happy Bubbles (play)
  371. Diamond thief (play)
  372. Combo Out Mini (play)
  373. Chanel Spring 2008 (play)
  374. tragaldabas (play)
  375. Simple Picross (play)
  376. Sexxes (play)
  377. Rocket Launch (play)
  378. Merlin's Christmas 3 (play)
  379. Halloweenies (play)
  380. Equilibrated Santa (play)
  381. Christmas Snowball (play)
  382. Catch a Falling Star (play)
  383. Arcane Islands (play)
  384. The Labyrinth (play)
  385. The Evils (play)
  386. Pop Pies (play)
  387. Capture the Flag (play)
  388. Candy Catastrophe (play)
  389. Bubble Schmubble (play)
  390. Mezzo: Winter Edition (play)
  391. Atomyx (play)
  392. -Evade- (play)
  393. SubMission (play)
  394. Ocean Catch Match (play)
  395. Mardok's Reign (play)
  396. EsTension (play)
  397. Captain Zorro (play)
  398. Skelzies (play)
  399. Hollowscream (play)
  400. Fragile (play)
  401. Christmas Sorter (play)
  402. 8bitrocket Space Eggs (play)
  403. Rotato (play)
  404. Orbtrex (play)
  405. WetDiamonds (play)
  406. Turret Defense Game (play)
  407. Say What?! (play)
  408. PiPi The Jumping Bubble (play)
  409. Pacco 2 (play)
  410. Oceanic (play)
  411. Klaverjassen (play)
  412. Color Buster (play)
  413. BaffleBees (play)
  414. Head on a Stick (play)
  415. Winter Bells (play)
  416. Wichita Faro (play)
  417. Space Sokoban (play)
  418. Diamonds Jungle (play)
  419. Shi Sen (play)
  420. O Quarto (play)
  421. Hexagon Garden (play)
  422. Gobble (play)
  423. Dopefish (play)
  424. Balloonitarium (play)
  425. Spider Game (play)
  426. Grasp The Balls (play)
  427. Final Strike (play)
  428. Ball Buster (play)
  429. Asteroid Rampage (play)
  430. Zombie Kitten Attack (play)
  431. Slippery Breakout (play)
  432. Radical Racing (play)
  433. Madness Interface (play)
  434. Encuentra (play)
  435. ClickRace (play)
  436. Ultra Avoiding 2 (play)
  437. Multiball (play)
  438. Laser pong (play)
  439. Dodge Bubbles (play)
  440. Countdown Dice (play)
  441. Blinkin' (play)
  442. snorol (play)
  443. Zombie Kill Adventure (play)
  444. Swarm (play)
  445. Monster Attack (play)
  446. Magneto 3 (play)
  447. Dragon Fury (play)
  448. Absolute Zero (play)
  449. Voracity (play)
  450. Space Creeps (play)
  451. Red Devil Coin Collector (play)
  452. Red Arrows (play)
  453. Pixel Maze Platformer (play)
  454. Maze Madness (play)
  455. Christmas Color Derby (play)
  456. blockdodge (play)
  457. Wiidoku (play)
  458. Virtual Dog (play)
  459. The Plant (play)
  460. Match Em Up Deluxe (play)
  461. Magneto (play)
  462. Firewall (play)
  463. Exodus I: The Search (play)
  464. Elementris (play)
  465. Burbujas (play)
  466. Attack Of The Sprouts (play)
  467. Opposite Squares: EL (play)
  468. NightGlider (play)
  469. Mute (play)
  470. Virtual Cat (play)
  471. Tilt 2 (play)
  472. Swinging ball (play)
  473. Poker Patience (play)
  474. Flash Bowls (play)
  475. Olive War (play)
  476. GAS (play)
  477. Droplet (play)
  478. Double Twelve (play)
  479. Ball Blast (play)
  480. Super Mouse Game 4 (play)
  481. Pi Runner (play)
  482. POCKET POOL (play)
  483. La Cucaracha (play)
  484. ChessCards (play)
  485. Ballistic Balloon Baboon Bounce (play)
  486. Torque (play)
  487. Mustachr (play)
  488. Chicken Flu (play)
  489. Balls (play)
  490. Shape Defense (play)
  491. Nibblets (play)
  492. ocean hunt (play)
  493. Lunar Mission (play)
  494. Levers (play)
  495. Top Fish (play)
  496. Ultra Avoiding (play)
  497. Safe Cracker (play)
  498. Precision (play)
  499. Keep it Balanced (play)
  500. Jump It (play)
  501. Cogenix (play)
  502. Frog The Fly (play)
  503. Air Football! (play)
  504. Yum Yum (play)
  505. LineAthlete (play)
  506. KAMAKAZE! (play)
  507. Flight of the Bumblebee (play)
  508. Bubble (play)
  509. Folio Frenzy (play)
  510. Billy the Ball (play)
  511. Asteroid Defense (play)
  512. Pharoahs Treasure (play)
  513. Get Back To It! (play)
  514. Def Beat 2 (play)
  515. Halloween (play)
  516. Granite Head Flying Rock Man (play)
  517. ClickDragType3 (play)
  518. Abstract Sea (play)
  519. camera mind (play)
  520. Viral Vendetta (play)
  521. Vup (play)
  522. NelkSnake (play)
  523. Rocketcat (play)
  524. Hungerus Maximus (play)
  525. Why do you torment me candy? (play)
  526. Roto Foto (play)

Where is your game?

Other Links: Games Daily Games

Designing the structure of a Flash game

One of the most interesting things about internet publishing is that you can receive feedback almost in real time.

For this reason, it's very important to read every comment and above all negative comments.

When I released Tileball, I received some negative comments about the title screen. That's right: I focused on the game and I did not care about a title screen, or a proper "congratulations" screen if a player manages to beat all levels.

When I was a kid, the "end screen" was very important. I remember myself playing some "not so good" games just to see how will they thank me for playing in their congratulations screen.

Too bad I forgot old times and released a game with such a lame intro and end screen.

I think it happened because I coded a lot of actionscript and did not want to nest more code to manage different game status such as info screen, welcome screen, and so on.

So I decided to make a Flash movie with the very basic structure every game should have.

This structure is made of:

* A "title" movieclip
* An "info" movieclip
* The game itself
* A "game over" movieclip
* A "congratulations" movieclip

Let's see how do they work:

Title movieclip: it's the first thing the player sees when the movie has loaded. It should have some appeal, just to tell players "hey, I'm a good game, give me a try"

Info movieclip: here you will put all instructions to play the game, or more information about the game.

The game itself: the most important thing, don't forget it...

Game over movieclip: The screen the player will see once he dies and runs out of all lives, or runs out of time, or simply does not beat all levels. Here you can show highscores.

Congratulations movieclip: This is the screen the player will see should he ever complete the game. Congratulations, blah blah blah, show the highscores and play again

It's very important that you include at least these sections, or your game will have an "home made" feeling. Now, we all know your game is home made, but we don't want our game to seem "home made when sit in the bathroom".

Come on, and let's see how did I arrange actionscript and movieclips to have a game with the above features.

First, the actionscript: Read more

3 attacks in a week should be enough

I posted about an attack to this blog in this post, and since then I had 3 more attacks, all in the last week.

All attacks are very similar, with a php injection in the index page.

The most interesting thing is that ob_start("phpfake"); code still does not appear that much on Google, even if more than 10 days passed since I posted about it.

It's only me? I cannot believe I am the only WP blogger that faced this attack. I also updated the blog to the last version, but attacks continue.

Oh well, meanwhile I added about 10 more addresses in the mailing list you can use to submit your Flash games...

Some email addresses to send your games

Ok, so you finished your game, you submitted it to NG and Kongregate and now you are about to submit it to another million of sites to give it a good exposure.

The only problem is that most sites require a registration, some want a 60x60 gif thumbnail while others want a 100x100 png. Submitting your game to a lot of sites is a hassle. Lucky me that some portals accept submission by email.

I am making a list of email addresses of portals that want you to send your game by email. So you can create a little php script (I will create one later) to send the same mail to all addresses and save a lot of time.

I am doing this way. How will I manage attachments? I'll simply include in the mail a link to my game in NG (if it has a decent score) and a link to a zip file with the .swf itself and two images, a .gif and a .jpg

This is the file I will send:
http://www.emanueleferonato.com/stuff/tileball/tileball.zip.

Doing this way, I will be able to submit Tileball to more than 30 portals in a click. On the other hand, all those portals won't receive any heavy attachment and can dedice to download the game or not.

This is the list of addresses I found as today. Should you know one more, just leave a comment.

3cr[at]dabontv.com (www.dabontv.com)
AGgames[at]addictinggames.com
blitzgamer.com[at]gmail.com (www.blitzgamer.com)
captinmorgn[at]bellsouth.net (www.arcadenut.com)
chris1335[at]hotmail.com (www.gamesloth.com)
colorin[at]caracol.com.co (www.colorincolorradio.com)
developers[at]mindjolt.com (www.mindjolt.com)
enquiries[at]mousebreaker.co.uk
fifadicto[at]yahoo.es (www.juegosdiarios.com)
flashgame.net[at]gmail.com (www.flash-game.net)
freegamesnews[at]gmail.com (www.freegamesnews.com)
game[at]2flashgames.com (www.2flashgames.com)
gamedev[at]miniclip.com (www.mindjolt.com)
gamegod[at]freearcade.com (www.freearcade.com)
gameprison[at]gmail.com (www.gameprison.com)
gamesolo[at]gmail.com (www.gamesolo.com)
info[at]bigwigmedia.com (www.2dplay.com)
info[at]bubblebox.com
info[at]freegamesjungle.com
info[at]hatekonyan.hu (jatek.hatekonyan.hu)
info[at]startgames.ws
info2007[at]coffeebreakarcade.com (www.coffeebreakarcade.com)
jobs[at]mousebreaker.co.uk (www.mousebreaker.com)
KST_Admin[at]killsometime.com (www.killsometime.com)
mikemaxgames[at]gmail.com (www.maxgames.com)
minijuegos[at]gmail.com (www.minijuegos.com)
onlinegamesflash[at]yahoo.com (www.onlinegamesflash.com)
plemsoft[at]plemsoft.com (www.playgames2.com)
selfdefiant[at]melting-mindz.com
sponsor[at]gimme5games.com
submissions[at]smileygamer.com
t45ol.com[at]gmail.com (en.t45ol.com)
tom[at]thorgaming.com
vorarg[at]comcast.net (www.gamesflasher.com)
webdesign[at]info.lt (www.joker.lt)
webmaster[at]flashninjaclan.com
webmaster[at]gamegarage.co.uk (www.gamegarage.co.uk)
webmaster[at]gamesportal.org (www.gamesportal.org)
webmaster[at]gametheflash.net (www.gametheflash.net)
webmaster[at]hispajuegos.net (www.hispajuegos.net)
webmaster[at]smashingames.com (www.smashingames.com)
webmasterp[at]jeux-internet.com (www.jeux-internet.com)
webmaster[at]thaiza.com (gameonline.thaiza.com)
wepinc[at]gmail.com
yourclueless[at]gmail.com (www.zoopgames.com)

When Elasticity meets Bloons

Ok, so we have two games: Elasticity and Bloons.

The first, is a game I talked about in Controlling a ball like in Flash Elasticity game tutorial, and I suggest you to read it, while the second is a game we all use to play here on planet Earth.

Despite the psychedelic feeling I gave to the graphics in this prototype, merging two game genres like Bloons and Elasticity can lead to some interesting gameplay concepts.

So the prototype brings the "engine" of Elasticity and some targets to destroy like in Bloons.

No tutorial yet but only a commented actionscript

ACTIONSCRIPT:
  1. attachMovie("newmouse", "newmouse", _root.getNextHighestDepth());
  2. attachMovie("circle", "circle", _root.getNextHighestDepth(), {_x:60, _y:350});
  3. attachMovie("crosshair", "crosshair", _root.getNextHighestDepth());
  4. attachMovie("ball", "ball", _root.getNextHighestDepth());
  5. Mouse.hide();
  6. // friction
  7. friction = 0.9;
  8. // multiplier to scale down ball speed
  9. speed_scale = 0.1;
  10. // ball x and y speed
  11. xspeed = 0;
  12. yspeed = 0;
  13. // flag to determine if the ball is "free" (I released it) or not
  14. free_ball = false;
  15. // gravity is zero at the beginning
  16. gravity = 0;
  17. // this part has been already explained
  18. newmouse.onEnterFrame = function() {
  19.     this._x = _root._xmouse;
  20.     this._y = _root._ymouse;
  21. };
  22. crosshair.onEnterFrame = function() {
  23.     difference = (circle._width-crosshair._width)/2;
  24.     this._x = _root._xmouse;
  25.     this._y = _root._ymouse;
  26.     dist_x = this._x-circle._x;
  27.     dist_y = this._y-circle._y;
  28.     distance = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
  29.     if (distance>difference) {
  30.         angle = Math.atan2(dist_y, dist_x);
  31.         this._x = circle._x+difference*Math.cos(angle);
  32.         this._y = circle._y+difference*Math.sin(angle);
  33.     }
  34. };
  35. ball.onEnterFrame = function() {
  36.     if (!free_ball) {
  37.         dist_x = (crosshair._x-this._x)*speed_scale;
  38.         dist_y = (crosshair._y-this._y)*speed_scale;
  39.         xspeed += dist_x;
  40.         yspeed += dist_y;
  41.     } else {
  42.         if (this._y>500) {
  43.             free_ball = false;
  44.             gravity = 0;
  45.             xspeed = 0;
  46.             yspeed = 0;
  47.             this._x = crosshair._x;
  48.             this._y = crosshair._y;
  49.             friction = 0.9;
  50.         }
  51.     }
  52.     xspeed *= friction;
  53.     yspeed *= friction;
  54.     yspeed += gravity;
  55.     this._x += xspeed;
  56.     this._y += yspeed;
  57. };
  58. // if the player release the mouse, then
  59. // the ball is set to free
  60. // the friction is lower and
  61. // the gravity is bigger
  62. _root.onMouseDown = function() {
  63.     free_ball = true;
  64.     friction = 0.99;
  65.     gravity = 0.3;
  66. };
  67. // adding some "bloons"...
  68. for (x=0; x&lt;8; x++) {
  69.     for (y=0; y&lt;8; y++) {
  70.         bloon = _root.attachMovie("bubble", "bubble_"+x, _root.getNextHighestDepth(), {_x:250+x*30, _y:30+y*30});
  71.         bloon.die = false;
  72.         bloon.onEnterFrame = function() {
  73.             // actions to perform if the bloon is "alive"
  74.             if (!this.die) {
  75.                 dist_x = this._x-ball._x;
  76.                 dist_y = this._y-ball._y;
  77.                 distance_from_ball = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
  78.                 // checking if the ball hits the bloon
  79.                 if (distance_from_ball<(this._width+ball._width)/2) {
  80.                     this.die = true;
  81.                 }
  82.                 // actions to perform if the bloon is "dead"
  83.             } else {
  84.                 this._width -= 1;
  85.                 this._height -= 1;
  86.                 this._alpha -= 2;
  87.                 if (this._alpha == 0) {
  88.                     this.removeMovieClip();
  89.                 }
  90.             }
  91.         };
  92.     }
  93. }

And this is the result, swing the ball with the mouse and press mouse button to throw it against the "bloons". Read more

Tileball, the FIRST game made with my tile ball engine

I published Tileball, the FIRST (and I want you to notice the capitalized "FIRST") game made with my tile ball engine.

Tileball

I learned so much in the making of this game that once finished I wanted to delete it and start making it again. Then, I decided to release the game and practice all I learned into the making of Tileball II.

The first thing I want you to know is that Tileball is not a clone of Marble Madness. When I started coding it, I had in mind an old Commodore 64 glory called Trailblazer

Trailblazer

I played Trailblazer to death when I was 14 and I wanted to make a clone of it, with some modifications (I did not like the fake 3d graphics of the original). This is why Tileball is played into deep space.

Since there are two or three clones of Tileball around the web, I introduced the jumping tile to give players a new feature. I will explain the jumping tile with next tutorial, and a lot more tiles are planned, as well as a two player options with the old "split screen" mode and a level editor.

The first thing I learned is that there is an issue with the switch actionscript that will mess you the code if you have a lot of code into any case. Unfortunately I forgot to take a screenshot of the problem but I will try to replicate it and show you.

The second one is a damn hard question...

Engine vs level design

With the game engine ready and tested, I firstly planned to release the game with 50 levels. Then I went mad designing the FIRST one, and I decided to release the game with 8 levels. Finally, I completed the game with 12 levels. It's interesting to notice that I coded the entire engine in less than two hours, and I spent more than half an hour for each level.

When you design a level you have to play it, then make some changes, then play again, then make some changes, then play another time just to realize it was better 5 minutes ago, so you have to make some changes and play it again.

Once it's finished, you'll play it another two or three times because you think it's a damn good level and you are enjoying playing with it.

In real game industry, I can only imagine how long does it take to make a level and I am not longer surprised that the best level designers are hired and well paid by software houses.

When you play a game, you probably don't notice any detail because you have more important task to do: headshot bad guys, avoiding bullets, throwing grenades and so on, but I want you to look at some "screenshots" at Panogames and see how every location is almost a real environment.

The power of level design..

Now the third question...

Easy game or hard game?

Some people prefer to play easy games, other hard ones. As an old-time player, I prefer hard games. Hard but not frustrating. I tried to give the "hard but not frustrating" feeling in Tileball, but you know, level design is an hard thing.

Obviously I am going to monetize this game too, but I'll talk about it in the next part of my experiment.

Create a Flash ball game with visual from above tutorial part 3

January 16th update: 4th part released

In the third part of this tutorial I am going to fix a minor bug and introduce three new tiles:

info tile (displays a message when the ball rolls over it)
reverse control tile (reverses the controls of the ball)
checkpoint tile (makes you respawn at the checkpoint tile if you die)

Before continuing, I suggest you to read tutorials 1 and 2.

The actionscript of the last example has changed to:

ACTIONSCRIPT:
  1. _root.attachMovie("starz", "starz", 1, {_x:-20, _y:-20});
  2. _root.attachMovie("ball", "ball", 3, {_x:240, _y:220});
  3. _root.attachMovie("info_panel", "info_panel", 4, {_y:410, _alpha:50, _visible:false});
  4. ball.texture.setMask(ball.ball_itself);
  5. yspeed = 0;
  6. xspeed = 0;
  7. checkpoint_passed = false;
  8. lev = 1;
  9. draw_level(lev);
  10. ball.onEnterFrame = function() {
  11.     info_panel._visible = false;
  12.     friction = 0.99;
  13.     power = 0.4;
  14.     brick_x = Math.floor((bricks._x-200)/80)*-1;
  15.     brick_y = Math.floor((bricks._y-180)/80)*-1;
  16.     type_of_tile = level[brick_y][brick_x];
  17.     if (type_of_tile>12000) {
  18.         message_to_show = messages[type_of_tile%12000];
  19.         type_of_tile = 12;
  20.     }
  21.     switch (type_of_tile) {
  22.     case 1 :
  23.         // normal tile
  24.         break;
  25.     case 2 :
  26.         // down spin tile
  27.         yspeed += 0.2;
  28.         break;
  29.     case 3 :
  30.         // up spin tile
  31.         yspeed -= 0.2;
  32.         break;
  33.     case 4 :
  34.         // left spin tile
  35.         xspeed -= 0.2;
  36.         break;
  37.     case 5 :
  38.         // right spin tile
  39.         xspeed += 0.2;
  40.         break;
  41.     case 6 :
  42.         // glass tile
  43.         depth = brick_y*12+brick_x;
  44.         bricks["brick_"+depth]._alpha--;
  45.         if (bricks["brick_"+depth]._alpha&lt;1) {
  46.             level[brick_y][brick_x] = 0;
  47.         }
  48.         break;
  49.     case 7 :
  50.         // spin tile
  51.         xspeed *= 1.05;
  52.         yspeed *= 1.05;
  53.         break;
  54.     case 8 :
  55.         // slip tile
  56.         friction = 1;
  57.         power = 0;
  58.         break;
  59.     case 9 :
  60.         // beam
  61.         depth = brick_y*12+brick_x;
  62.         if (bricks["brick_"+depth].lava._currentframe>90) {
  63.             ball_die();
  64.         }
  65.         break;
  66.     case 10 :
  67.         // exit
  68.         checkpoint_passed = false;
  69.         lev++;
  70.         _root.removeMovieClip("bricks");
  71.         draw_level(lev);
  72.         break;
  73.     case 11 :
  74.         // reverse
  75.         power *= -1;
  76.         break;
  77.     case 12 :
  78.         // info
  79.         info_panel._visible = true;
  80.         info_panel.message_text.text = message_to_show;
  81.         break;
  82.     case 13 :
  83.         //checkpoint
  84.         checkpoint_passed = true;
  85.         save_x = brick_x;
  86.         save_y = brick_y;
  87.         break;
  88.     default :
  89.         // hole
  90.         ball_die();
  91.         break;
  92.     }
  93.     if (Key.isDown(Key.LEFT)) {
  94.         xspeed -= power;
  95.     }
  96.     if (Key.isDown(Key.RIGHT)) {
  97.         xspeed += power;
  98.     }
  99.     if (Key.isDown(Key.UP)) {
  100.         yspeed -= power;
  101.     }
  102.     if (Key.isDown(Key.DOWN)) {
  103.         yspeed += power;
  104.     }
  105.     xspeed *= friction;
  106.     yspeed *= friction;
  107.     if ((xspeed&lt;0.1) and (xspeed>-0.1)) {
  108.         xspeed = 0;
  109.     }
  110.     if ((yspeed&lt;0.1) and (yspeed>-0.1)) {
  111.         yspeed = 0;
  112.     }
  113.     bricks._y -= yspeed;
  114.     bricks._x -= xspeed;
  115.     starz._x = -20+((bricks._x-240)/10);
  116.     starz._y = -20+((bricks._y-220)/10);
  117.     this.texture._y += yspeed;
  118.     this.texture._x += xspeed;
  119.     if (this.texture._x>53) {
  120.         this.texture._x -= 63;
  121.     }
  122.     if (this.texture._x<-53) {
  123.         this.texture._x += 63;
  124.     }
  125.     if (this.texture._y>53) {
  126.         this.texture._y -= 63;
  127.     }
  128.     if (this.texture._y<-53) {
  129.         this.texture._y += 63;
  130.     }
  131. };
  132. function ball_die() {
  133.     bricks._x = 240-(80*_root.ball_start_x);
  134.     bricks._y = 220-(80*_root.ball_start_y);
  135.     xspeed = 0;
  136.     yspeed = 0;
  137.     draw_level(lev);
  138. }
  139. function draw_level(number) {
  140.     yspeed = 0;
  141.     xspeed = 0;
  142.     level = new Array();
  143.     messages = new Array();
  144.     switch (number) {
  145.     case 1 :
  146.         _root.ball_start_x = 0;
  147.         _root.ball_start_y = 0;
  148.         if (checkpoint_passed) {
  149.             _root.ball_start_x = save_x;
  150.             _root.ball_start_y = save_y;
  151.         }
  152.         level[0] = new Array(12001, 11, 11, 11, 11);
  153.         level[1] = new Array(0, 0, 0, 0, 1);
  154.         level[2] = new Array(1, 1, 10, 0, 1);
  155.         level[3] = new Array(1, 0, 0, 0, 1);
  156.         level[4] = new Array(12003, 1, 1, 13, 12002);
  157.         messages[1] = "Welcome to the game";
  158.         messages[2] = "You are about to cross a checkpoint";
  159.         messages[3] = "Ok. Now suicide! You'll respawn on the checkpoint";
  160.         break;
  161.     case 2 :
  162.         _root.ball_start_x = 0;
  163.         _root.ball_start_y = 0;
  164.         level[0] = new Array(1, 4, 4, 5, 0);
  165.         level[1] = new Array(0, 0, 0, 1, 0);
  166.         level[2] = new Array(0, 0, 0, 1, 0);
  167.         level[3] = new Array(0, 0, 0, 10, 0);
  168.         level[4] = new Array(0, 0, 0, 0, 0);
  169.         break;
  170.     case 3 :
  171.         _root.ball_start_x = 0;
  172.         _root.ball_start_y = 0;
  173.         level[0] = new Array(1, 6, 6, 4, 0);
  174.         level[1] = new Array(0, 0, 0, 6, 0);
  175.         level[2] = new Array(6, 5, 5, 6, 0);
  176.         level[3] = new Array(6, 0, 0, 0, 0);
  177.         level[4] = new Array(1, 1, 10, 0, 0);
  178.         break;
  179.     case 4 :
  180.         _root.ball_start_x = 0;
  181.         _root.ball_start_y = 0;
  182.         level[0] = new Array(1, 7, 0, 0, 0);
  183.         level[1] = new Array(0, 7, 0, 7, 10);
  184.         level[2] = new Array(1, 3, 0, 1, 0);
  185.         level[3] = new Array(1, 0, 0, 1, 0);
  186.         level[4] = new Array(1, 1, 1, 7, 0);
  187.         break;
  188.     case 5 :
  189.         _root.ball_start_x = 4;
  190.         _root.ball_start_y = 2;
  191.         level[0] = new Array(7, 8, 8, 8, 10);
  192.         level[1] = new Array(1, 0, 0, 0, 0);
  193.         level[2] = new Array(1, 8, 8, 3, 1);
  194.         level[3] = new Array(0, 0, 0, 0, 0);
  195.         level[4] = new Array(0, 0, 0, 0, 0);
  196.         break;
  197.     case 6 :
  198.         _root.ball_start_x = 2;
  199.         _root.ball_start_y = 2;
  200.         level[0] = new Array(2, 8, 9, 8, 9);
  201.         level[1] = new Array(9, 0, 0, 0, 1);
  202.         level[2] = new Array(2, 8, 1, 0, 3);
  203.         level[3] = new Array(0, 0, 0, 0, 4);
  204.         level[4] = new Array(10, 9, 9, 8, 6);
  205.         break;
  206.     case 7 :
  207.         _root.ball_start_x = 2;
  208.         _root.ball_start_y = 2;
  209.         level[0] = new Array(0, 0, 0, 0, 0);
  210.         level[1] = new Array(0, 0, 0, 0, 0);
  211.         level[2] = new Array(0, 0, 1, 0, 0);
  212.         level[3] = new Array(0, 0, 0, 0, 0);
  213.         level[4] = new Array(0, 0, 0, 0, 0);
  214.         break;
  215.     }
  216.     _root.createEmptyMovieClip("bricks", 2);
  217.     bricks._x = 240-(80*ball_start_x);
  218.     bricks._y = 220-(80*ball_start_y);
  219.     for (y=0; y<=4; y++) {
  220.         for (x=0; x<=4; x++) {
  221.             if (level[y][x]>0) {
  222.                 depth = y*12+x;
  223.                 place_brick = bricks.attachMovie("brick", "brick_"+depth, bricks.getNextHighestDepth(), {_x:x*80, _y:y*80});
  224.                 frame_to_stop = level[y][x];
  225.                 if (frame_to_stop>12000) {
  226.                     frame_to_stop = 12;
  227.                 }
  228.                 place_brick.gotoAndStop(frame_to_stop);
  229.             }
  230.         }
  231.     }
  232. }

Let's comment the new lines: Read more

Next Page →

Posts