Brendon Smith AKA SeaCloud9 Design - tagged with game-creation http://life.brendonsmith.com/feed en-us http://blogs.law.harvard.edu/tech/rss Sweetcron brendonsmith@seacloud9.org Away3D Bullet Physics and MD2 and Waves http://life.brendonsmith.com/items/view/3574/away3d-bullet-physics-and-md2-and-waves

Away3D is the weapon of choice for 3D content on the Stage3D platform. Away3D offers a great deal of support for many model formats and integrates well with many other as3 libraries.  You will find that it is actually easy to integrate Away3D with several popular physics libraries including but not limited to Bullet and [...]

]]>
Sun, 08 Jan 2012 20:34:09 -0800 http://life.brendonsmith.com/items/view/3574/away3d-bullet-physics-and-md2-and-waves
CodeBreaker a Game of Deduction http://life.brendonsmith.com/items/view/1616/codebreaker-a-game-of-deduction

Let me first start of by simply telling you I have been reading MasterMind board game.  I decided to port over this game to JavaScript and have done this you can find the example by clicking book like I have.  A little background about the game if it says you have a correct spot and the correct color. If it says you have the correct color you have the correct color but it is in the incorrect spot.

// constants const numPegs = 5; const numColors = 5; const maxTries = 10; const horizOffset = 30; const vertOffset = 60; const pegSpacing = 30; const rowSpacing = 30;   // game play variables var solution = new Array(); var solutionButtonArray; var turnNum;   // references to display objects var buttonImages = new Array("img/cbBlack.png","img/cbGreen.png","img/cbYellow.png","img/cbPurple.png","img/cbRed.png", "img/cbBlue.png" ); var currentRow = new Array(); var currentText; var currentButton; var mainIds = 0; var myButton; function startGame() { for(var i =0;i<numPegs;i++) { // random, from 0 to 4 var r = Math.floor(Math.random()*numColors) + 1; solution.push(r); } turnNum = 0; createPegRow(); }   function createPegRow(start) { solutionButtonArray = new Array(); if(start == undefined){ $('#cbMainGame').html(""); } var cbButton1 = '<div class="divCButton" id="div'; var cbButton2 = '" onclick="clickButton(this)"><img id="img'; var cbButton3 = '" alt="0" src="img/cbBlack.png" /></div>'; var mainWrapper1 = '<div class="mainWrapper">'; var mainWrapper2 = '</div>'; $('#cbMainGame').append(mainWrapper1); var btnFinished = '<div class="imgButton" id="divButtonFinished'; var btnFinished2= '"><center><div class="mainButton" id="divButtonDone'; var btnFinished3= '" onclick="executeGameQuery(this)"><span id="spnMainButton">Done</span></div></center></div>'; currentRow = new Array(); for(i=0;i<numPegs;i++) { $('#cbMainGame').append(cbButton1+mainIds+cbButton2+mainIds+cbButton3); solutionButtonArray.push("img"+mainIds); mainIds++; } $('#cbMainGame').append(btnFinished+mainIds+btnFinished2+mainIds+btnFinished3+mainWrapper2); }   function clickButton(clicked){ var myButton = clicked; var img = $(clicked).find('img'); var imageToChange = img[0].alt.toString(); if(imageToChange == 6){ imageToChange = 0;
} //console.log(imageToChange); $("#"+img[0].id).attr("src",buttonImages[parseInt(imageToChange) + 1]); $("#"+img[0].id).attr("alt", parseInt(imageToChange) + 1); }   function executeGameQuery(mainButton){ var buttonClicked = mainButton; var changeThis = buttonClicked.id; var currentColorList = new Array(); var colorList = new Array(0,0,0,0,0); var soltionList = new Array(0,0,0,0,0); changeThis = $("#"+changeThis).parent().parent(); //console.log(changeThis); var numberCorrect = 0; var numberColorsCorrect = 0; turnNum++; for(i=0; i<numPegs; i++){ currentColorList.push($("#"+solutionButtonArray[i]).attr("alt")); $("#"+solutionButtonArray[i]).parent().removeAttr("onclick"); } for(i=0; i<numPegs; i++){ if(currentColorList[i] == solution[i] ){ numberCorrect++; }else{ soltionList[solution[i]]++; colorList[parseInt(currentColorList[i])]++; } } for(i=0; i<numColors; i++){ var test = Math.min(soltionList[i],colorList[i]); numberColorsCorrect = numberColorsCorrect + Math.min(soltionList[i],colorList[i]); } $("#"+buttonClicked.id).remove(); if(numberCorrect == numPegs){ $(changeThis).html('You Got It!<br/><div class="imgButton"><center><div onclick="startGame()" id="divButtonDone5" class="mainButton"><span id="spnMainButton">Play Again</span></div></center></div>'); }else if(turnNum == maxTries){ $(changeThis).html('I regret to infrom you just lost next time do it quicker! <br/><div class="imgButton"><center><div onclick="startGame()" id="divButtonDone5" class="mainButton"><span id="spnMainButton">Play Again</span></div></center></div>');   } else{ $(changeThis).html("Correct Spot: "+numberCorrect+", Correct Color: "+numberColorsCorrect); var start = true; createPegRow(start); } } $(document).ready(function() { $('#cbMainGame').append(startGameHTML);
});

RayCasters the old style 3d of Games like Wolfenstien and Doom.  In short most of the raycasters out their follow this SDL lib an old library that was used to create most video games years ago.  I searched to see if someone was doing something similar and sure enough someone is haXe has an SDL wrapper.  This might also be useful to study RayFaster2 this is a RayCaster built with haXe that is super fast.  Their are numerous examples of RayCasters written in ActionScript but I am looking for speed.  I might think about also just writing one from scratch and implementing a JavaScript version of it as well.  I could have spent this weekend working on my new portfolio but unfortunately I didn’t do that:(  I will have to extend it deadline beyond the 4 days time limit once again:(

]]>
Sun, 04 Apr 2010 13:01:45 -0700 http://life.brendonsmith.com/items/view/1616/codebreaker-a-game-of-deduction
Unity3d and Other Rants http://life.brendonsmith.com/items/view/16/unity3d-and-other-rants

Unity3d just came out with support for the Wii! Unity is also going to be working on the iPhone soon. Thats cool so what is Unity? Unity is a game engine that allows developers to rapidly create games on multiple platforms. Unity also has a $200 indie developer license (please note the WiiWare licensed content I think is still about 5,000 dollars or more could be off on those digits but it is in the ball park) available so people who don’t really want to shell out a ton of money can purchase it and play with it to create content. Because unity3d (oh and FYI it was created with Mono) is a game engine you obviously will need a 3d creative suite and Blender 3d is just the tool for you. Blender has been around now for awhile and has many features that will help you create your 3 dimensional worlds with relative ease. Blender has a great deal of support in the open source community and has been used to create some movies and games. So check it out. As you might have heard by now (hopefully) Flash also has 3d support Astro (Flash Player 10) is going to have more hardware support. Currently in ActionScript 3 you have the ability to create 3d environments but if you are a sloppy coder your 3d environment might render slowly due to lack of hardware acceleration. Flash has been used to create some wonderful projects and you can view these by looking into PaperVision 3d (AS3), Sandy(AS2-3), oh and wouldn’t it be nice to do something with your 3d models in flash look at WOW or APE for physics. I also have been chatting on facebook with Benoit Beausejour he is a papervision developer recently check out some of his examples they are pretty cool. Below is an example of Unity3d in action. This reel was created by Raimund Schumacher a Unity 3d Devloper

In other news I have also been pretty busy working on our wedding site which will be up shortly. I have also been plugging away at converting iHang10.com to the new version of CakePHP 1.2 which is currently in Release Candidate 1. The new version has ACL built in so I had to strip out the current Action Control List. Anyway it has lots of features that are well worth a look so check it out. I have also been working on making i-create work on all browsers it currently works perfectly on ie6, ie7, Opera, Firefox 2 - 3, and Safari. So that about covers it I am going to go and enjoy the rest of my evening. Bookmark and Share More »Powered by Bookmarkify™

]]>
Tue, 10 Jun 2008 18:25:53 -0700 http://life.brendonsmith.com/items/view/16/unity3d-and-other-rants