Jump to content
  • Advertisement

aleisterbukowski

Member
  • Content Count

    288
  • Joined

  • Last visited

Community Reputation

146 Neutral

About aleisterbukowski

  • Rank
    Member
  1. aleisterbukowski

    SourceSDK sources?

    Thanks that's extremely helpful
  2. aleisterbukowski

    Unity SourceSDK sources?

    I know of the Valve Community Network, and I've been researching on it for 2 days now, but I was wondering if Gamedev.net had resources about the SourceSDK.. Let me know if anyone knows of any other good places to get good tutorials for the SourceSDK. Thanks,
  3. aleisterbukowski

    Car steering

    Quote:Original post by bzroom There's always this fine tutorial written by a fine gentleman: http://www.gamedev.net/reference/programming/features/2dcarphys/ Nice tutorial man!
  4. I would say it's easier to just use the bounding box algorithm. For AABB read this tutorial http://lazyfoo.net/SDL_tutorials/lesson17/index.php
  5. I'm thinking it's the "Make File" tool I'm trying to use. Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions" http://www.palib.info/wiki/doku.php?id=day1 and I have followed the steps verbatim, but haven't been able to successfully build the project. I get the wizard app started, I get the IntelliSense, but when I build it I get the following error. I'm reading this wiki http://www.palib.info/wiki/doku.php?id=day1
  6. Hi, I'm currently working on a game in Visual C++, and as I was compiling it I was received the following error. Project : error PRJ0002 : Error result 255 returned from 'C:\WINDOWS\system32\cmd.exe'. I thought at first I read the wiki incorrectly, so I made a simple console hello app, but then when I tried to build it I recieved the same error of Project : error PRJ0002 : Error result 255 returned from 'C:\WINDOWS\system32\cmd.exe'. I'm completely baffled by this error, and I'm thinking could it be that I'm running Visual Studio 2010 on my second hard drive, but I installed it through the hard drive that is currently running VS 08 ? [/source]
  7. I've finally started looking into XNA, and I went through some 2d tutorials and created an original game, and it was pretty straight forward, but then when I tried to look at a 3d starter kit I had no shader support. I'm using an hp dv5000 which has no custom video card except an intel graphics on board chip. Is there a way for me to make some 3d game even if it doesn't look amazing on my machine, or is it just time to upgrade to a new machine that can take anything? I'm out of a job right now, because of the recession so I have no income, so the latter of buying a new rig for me is totally out of the question. But, I would like to start testing and coding a 3d game by tomorrow and make it my all day project for Sunday.
  8. Hi, I'm trying to add a key event to my singleton object management class that I have, and with what I have and the test I have run I have not been successful. Here I have a canvas called myCanvas that adds a keyboard event listener, and checks for the function keyPressed. myCanvas.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); Now I have an entity manager class that manages all objects. A gameObject class, which is the abstract class that all of my objects extend from/to to inherit the gameObject functionality. Here is GameEntity (the resource management class of all game objects) package { import flash.display.*; import flash.events.KeyboardEvent; import mx.collections.*; import mx.core.*; public class EntityManager { // double buffer public var backBuffer:BitmapData; public var clearColor:uint = 0x333333; protected static var instance:EntityManager = null; protected var lastFrame:Date; protected var gameObjects:ArrayCollection = new ArrayCollection(); protected var newGameObjects:ArrayCollection = new ArrayCollection(); protected var removedGameObjects:ArrayCollection = new ArrayCollection(); protected var nemousArray:Array = new Array(); protected var player:Player; protected var nemous:Nemous; //if we don't exist create ourselve's static public function get Instance():EntityManager { if ( instance == null ) instance = new EntityManager(); return instance; } //constructor of EntityManager public function EntityManager() { if ( instance != null ) throw new Error( "Only one Singleton instance should be instantiated" ); //create the back buffer where we will draw all game entities on the screen backBuffer = new BitmapData(Application.application.width, Application.application.height, false); } //start up "instataniate all game entities in the game. that needs to be started when loading the game. public function startup():void { lastFrame = new Date(); player = new Player(); nemous = new Nemous(); player.startupPlayer(); nemous.startupNemous(); } //shutdown all entities public function shutdown():void { shutdownAll(); } //update public function enterFrame():void { // Calculate the time since the last frame var thisFrame:Date = new Date(); var seconds:Number = (thisFrame.getTime() - lastFrame.getTime())/1000.0; lastFrame = thisFrame; removeDeletedGameObjects(); insertNewGameObjects(); // now allow objects to update themselves for each (var gameObject:GameObject in gameObjects) { if (gameObject.inuse) gameObject.enterFrame(seconds); } drawObjects(); } //get keys public function keyPressed(evt:KeyboardEvent):void { } //draw all objects onto the back buffer "double buffer" protected function drawObjects():void { backBuffer.fillRect(backBuffer.rect, clearColor); // draw the objects for each (var gameObject:GameObject in gameObjects) { if (gameObject.inuse) gameObject.copyToBackBuffer(backBuffer); } } //add specific game object "Entity" to the array public function addGameObject(gameObject:GameObject):void { newGameObjects.addItem(gameObject); } //remove specific game object "Entity" to the array public function removeGameObject(gameObject:GameObject):void { removedGameObjects.addItem(gameObject); } //dispose of all objects by moving them to the remove object array, so we only shut them down once protected function shutdownAll():void { // don't dispose objects twice for each (var gameObject:GameObject in gameObjects) { var found:Boolean = false; for each (var removedObject:GameObject in removedGameObjects) { if (removedObject == gameObject) { found = true; break; } } if (!found) gameObject.shutdown(); } } //inset entities "new gameObjects into the array for use protected function insertNewGameObjects():void { for each (var gameObject:GameObject in newGameObjects) { for (var i:int = 0; i < gameObjects.length; ++i) { if (gameObjects.getItemAt(i).zOrder > gameObject.zOrder || gameObjects.getItemAt(i).zOrder == -1) break; } gameObjects.addItemAt(gameObject, i); } newGameObjects.removeAll(); } //remove all game objects "Entites" in the array that need to be deleted from the removedGameObjects array protected function removeDeletedGameObjects():void { // insert the object acording to it's z position for each (var removedObject:GameObject in removedGameObjects) { var i:int = 0; for (i = 0; i < gameObjects.length; ++i) { if (gameObjects.getItemAt(i) == removedObject) { gameObjects.removeItemAt(i); break; } } } removedGameObjects.removeAll(); } } } Specifically take a look at the KeyPressed that is called //get keys public function keyPressed(evt:KeyboardEvent):void { } in my gameObject I have the following as well, which can be over written by the classes that are extended from gameObject package { import flash.display.*; import flash.events.*; import flash.geom.*; /* The base class for all objects in the game. */ public class GameObject { // object position public var position:Point = new Point(0, 0); // higher zOrder objects are rendered on top of lower ones public var zOrder:int = 0; // the bitmap data to display public var graphics:GraphicsResource = null; // true if the object is active in the game public var inuse:Boolean = false; public function GameObject() { } public function startupGameObject(graphics:GraphicsResource, position:Point, z:int = 0):void { if (!inuse) { this.graphics = graphics; this.zOrder = z; this.position = position.clone(); this.inuse = true; EntityManager.Instance.addGameObject(this); //GameObjectManager.Instance.addGameObject(this); } } //change image if needed public function setGraphic(graphics:GraphicsResource):void { this.graphics = graphics; } public function shutdown():void { if (inuse) { graphics = null; inuse = false; EntityManager.Instance.removeGameObject(this); //GameObjectManager.Instance.removeGameObject(this); } } //copy image to the back buffer. public function copyToBackBuffer(db:BitmapData):void { db.copyPixels(graphics.bitmap, graphics.bitmap.rect, position, graphics.bitmapAlpha, new Point(0, 0), true); } //update frames public function enterFrame(dt:Number):void { } //get events public function keyPressed(evt:KeyboardEvent):void { } } } Take a close look at the keypressed event again //get events public function keyPressed(evt:KeyboardEvent):void { } Now finally the player class, which is the class that should check for events from the player, and call functions accordingly as they keys are pressed package { import flash.events.KeyboardEvent; import flash.geom.Point; import mx.controls.Text; import mx.core.*; public class Player extends GameObject { protected static const speed:Number = 10; protected var direction:Point = new Point(5, 5); protected var score:Text = new Text(); //constuctor of Player public function Player() { super(); } //start the player public function startupPlayer():void { super.startupGameObject(ResourceManager.RobotRightGraphics, new Point(2.0, 2.0)); score.text = "Score: "; } //shutdown the player override public function shutdown():void { super.shutdown(); } //change image if needed override public function setGraphic(graphics:GraphicsResource):void { this.graphics = graphics; } //update frame for player override public function enterFrame(dt:Number):void { super.enterFrame(dt); position.x += Motion2D.CalculateVelocity(direction.x*speed, dt); position.y += Motion2D.CalculateVelocity(direction.y*speed, dt); //position.x += direction.x * speed * dt; //position.y += direction.y * speed * dt; if (position.x >= Application.application.width - graphics.bitmap.width) direction.x = -1; else if (position.x <= 0) direction.x = 1; if (position.y >= Application.application.height - graphics.bitmap.height) direction.y = -1; else if (position.y <= 0) direction.y = 1; //change image depending on direction, which player is moving if(direction.x == -1) this.setGraphic(ResourceManager.RobotLeftGraphics); else this.setGraphic(ResourceManager.RobotRightGraphics); } //get key events, so we can move the player override public function keyPressed(evt:KeyboardEvent):void { super.keyPressed(evt); trace("key = " + evt.keyCode); } } } Specifically look at the keyPressed event again //get key events, so we can move the player override public function keyPressed(evt:KeyboardEvent):void { super.keyPressed(evt); trace("key = " + evt.keyCode); } I'm calling the KeyPressed function correctly, and I'm sending it to gameObject correctly am I not? however, it's not working they way it should work obviousely right? I was wondering if anyone see's anything that I could have possibly forgotten to add to get this singleton keyevent working as it should. Also would it just be a better idea to make a separate singleton key event manager and add it to the child of mycanvas that is checking for events? [/source]
  9. Hi, I'm trying to add a key event to my singleton object management class that I have, and with what I have and the test I have run I have not been successful. Here I have a canvas called myCanvas that adds a keyboard event listener, and checks for the function keyPressed. myCanvas.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); Now I have an entity manager class that manages all objects. A gameObject class, which is the abstract class that all of my objects extend from/to to inherit the gameObject functionality. Here is GameEntity (the resource management class of all game objects) package { import flash.display.*; import flash.events.KeyboardEvent; import mx.collections.*; import mx.core.*; public class EntityManager { // double buffer public var backBuffer:BitmapData; public var clearColor:uint = 0x333333; protected static var instance:EntityManager = null; protected var lastFrame:Date; protected var gameObjects:ArrayCollection = new ArrayCollection(); protected var newGameObjects:ArrayCollection = new ArrayCollection(); protected var removedGameObjects:ArrayCollection = new ArrayCollection(); protected var nemousArray:Array = new Array(); protected var player:Player; protected var nemous:Nemous; //if we don't exist create ourselve's static public function get Instance():EntityManager { if ( instance == null ) instance = new EntityManager(); return instance; } //constructor of EntityManager public function EntityManager() { if ( instance != null ) throw new Error( "Only one Singleton instance should be instantiated" ); //create the back buffer where we will draw all game entities on the screen backBuffer = new BitmapData(Application.application.width, Application.application.height, false); } //start up "instataniate all game entities in the game. that needs to be started when loading the game. public function startup():void { lastFrame = new Date(); player = new Player(); nemous = new Nemous(); player.startupPlayer(); nemous.startupNemous(); } //shutdown all entities public function shutdown():void { shutdownAll(); } //update public function enterFrame():void { // Calculate the time since the last frame var thisFrame:Date = new Date(); var seconds:Number = (thisFrame.getTime() - lastFrame.getTime())/1000.0; lastFrame = thisFrame; removeDeletedGameObjects(); insertNewGameObjects(); // now allow objects to update themselves for each (var gameObject:GameObject in gameObjects) { if (gameObject.inuse) gameObject.enterFrame(seconds); } drawObjects(); } //get keys public function keyPressed(evt:KeyboardEvent):void { } //draw all objects onto the back buffer "double buffer" protected function drawObjects():void { backBuffer.fillRect(backBuffer.rect, clearColor); // draw the objects for each (var gameObject:GameObject in gameObjects) { if (gameObject.inuse) gameObject.copyToBackBuffer(backBuffer); } } //add specific game object "Entity" to the array public function addGameObject(gameObject:GameObject):void { newGameObjects.addItem(gameObject); } //remove specific game object "Entity" to the array public function removeGameObject(gameObject:GameObject):void { removedGameObjects.addItem(gameObject); } //dispose of all objects by moving them to the remove object array, so we only shut them down once protected function shutdownAll():void { // don't dispose objects twice for each (var gameObject:GameObject in gameObjects) { var found:Boolean = false; for each (var removedObject:GameObject in removedGameObjects) { if (removedObject == gameObject) { found = true; break; } } if (!found) gameObject.shutdown(); } } //inset entities "new gameObjects into the array for use protected function insertNewGameObjects():void { for each (var gameObject:GameObject in newGameObjects) { for (var i:int = 0; i < gameObjects.length; ++i) { if (gameObjects.getItemAt(i).zOrder > gameObject.zOrder || gameObjects.getItemAt(i).zOrder == -1) break; } gameObjects.addItemAt(gameObject, i); } newGameObjects.removeAll(); } //remove all game objects "Entites" in the array that need to be deleted from the removedGameObjects array protected function removeDeletedGameObjects():void { // insert the object acording to it's z position for each (var removedObject:GameObject in removedGameObjects) { var i:int = 0; for (i = 0; i < gameObjects.length; ++i) { if (gameObjects.getItemAt(i) == removedObject) { gameObjects.removeItemAt(i); break; } } } removedGameObjects.removeAll(); } } } Specifically take a look at the KeyPressed that is called //get keys public function keyPressed(evt:KeyboardEvent):void { } in my gameObject I have the following as well, which can be over written by the classes that are extended from gameObject package { import flash.display.*; import flash.events.*; import flash.geom.*; /* The base class for all objects in the game. */ public class GameObject { // object position public var position:Point = new Point(0, 0); // higher zOrder objects are rendered on top of lower ones public var zOrder:int = 0; // the bitmap data to display public var graphics:GraphicsResource = null; // true if the object is active in the game public var inuse:Boolean = false; public function GameObject() { } public function startupGameObject(graphics:GraphicsResource, position:Point, z:int = 0):void { if (!inuse) { this.graphics = graphics; this.zOrder = z; this.position = position.clone(); this.inuse = true; EntityManager.Instance.addGameObject(this); //GameObjectManager.Instance.addGameObject(this); } } //change image if needed public function setGraphic(graphics:GraphicsResource):void { this.graphics = graphics; } public function shutdown():void { if (inuse) { graphics = null; inuse = false; EntityManager.Instance.removeGameObject(this); //GameObjectManager.Instance.removeGameObject(this); } } //copy image to the back buffer. public function copyToBackBuffer(db:BitmapData):void { db.copyPixels(graphics.bitmap, graphics.bitmap.rect, position, graphics.bitmapAlpha, new Point(0, 0), true); } //update frames public function enterFrame(dt:Number):void { } //get events public function keyPressed(evt:KeyboardEvent):void { } } } Take a close look at the keypressed event again //get events public function keyPressed(evt:KeyboardEvent):void { } Now finally the player class, which is the class that should check for events from the player, and call functions accordingly as they keys are pressed package { import flash.events.KeyboardEvent; import flash.geom.Point; import mx.controls.Text; import mx.core.*; public class Player extends GameObject { protected static const speed:Number = 10; protected var direction:Point = new Point(5, 5); protected var score:Text = new Text(); //constuctor of Player public function Player() { super(); } //start the player public function startupPlayer():void { super.startupGameObject(ResourceManager.RobotRightGraphics, new Point(2.0, 2.0)); score.text = "Score: "; } //shutdown the player override public function shutdown():void { super.shutdown(); } //change image if needed override public function setGraphic(graphics:GraphicsResource):void { this.graphics = graphics; } //update frame for player override public function enterFrame(dt:Number):void { super.enterFrame(dt); position.x += Motion2D.CalculateVelocity(direction.x*speed, dt); position.y += Motion2D.CalculateVelocity(direction.y*speed, dt); //position.x += direction.x * speed * dt; //position.y += direction.y * speed * dt; if (position.x >= Application.application.width - graphics.bitmap.width) direction.x = -1; else if (position.x <= 0) direction.x = 1; if (position.y >= Application.application.height - graphics.bitmap.height) direction.y = -1; else if (position.y <= 0) direction.y = 1; //change image depending on direction, which player is moving if(direction.x == -1) this.setGraphic(ResourceManager.RobotLeftGraphics); else this.setGraphic(ResourceManager.RobotRightGraphics); } //get key events, so we can move the player override public function keyPressed(evt:KeyboardEvent):void { super.keyPressed(evt); trace("key = " + evt.keyCode); } } } Specifically look at the keyPressed event again //get key events, so we can move the player override public function keyPressed(evt:KeyboardEvent):void { super.keyPressed(evt); trace("key = " + evt.keyCode); } I'm calling the KeyPressed function correctly, and I'm sending it to gameObject correctly am I not? however, it's not working they way it should work obviousely right? I was wondering if anyone see's anything that I could have possibly forgotten to add to get this singleton keyevent working as it should. Also would it just be a better idea to make a separate singleton key event manager and add it to the child of mycanvas that is checking for events? [/source]
  10. aleisterbukowski

    SDL - Multiple surface blit issue

    you could post some code. Then we could look at the code and tell you what's not working.
  11. aleisterbukowski

    SDL - Multiple surface blit issue

    I think what you're trying to do can easily be done with sprite sheets. I'm not fully understanding what you are trying to do, but in any case a single image should be blitted to the surface, which is then drawn to the screen, and there shouldn't be any complexities with that. If you want I can dig out my old code, and we can jump on AIM, or MSN and I can walk you through this if you'd like? AIM coden4fun MSN coden4fun@hotmail.com in any case maybe going to this tutorial here could help you out anyways as blitting a surface correctly, or if you are what I'm guessing you are doing which is using sprite sheets it's a good tutorial anyways. Good Luck, and if you can't figure it out I'll be online another 6 hours
  12. aleisterbukowski

    Game Engine Question...

    simply just start making games, and as you do you will realize there are so much code that you will be reusing from game to game, and then you will find ways to enhance this reusable code, and make advancements to it, and what will you have? The start of a game engine... Of course there are game engine, libraries, API's out there that will help you out. And, so I don't have to ask many questions I will just list you a bunch of stuff for ya. API's DirectX 3d/2d OpenGL 3d/2d Libraries Allegro 2d mostly can accomplish 3d with OpenGL SDL 2d mostly can accomplish 3d with OpenGL XNA (games for windows, xbox360, and if you update to 3.0 the zune player) 3d/2d Game Engines A list of freeware and open-source engines Have fun!
  13. aleisterbukowski

    A good way to store game settings / saves

    I would go with xml as well. you'll be using the System.Xml namespace, so start at the MSDN documentation. Aslo to get you started I googled using System.Xml, and thought the following article would be good Reading and Writing Xml in C# if it's as promising as I think it is it'll be the only tutorial you need. Then once you save game you write to the xml, and if you want to open up a game you simply read a specific xml file. Hope this helps!
  14. aleisterbukowski

    [web] Website: Static HTML or PHP?

    If you want dynamic go for PHP. HTML is just too plain, and static and not much can be done with it. Especially if you in the future decide to host a db for your site for storing various things from articles, games, users and passwords for your forum? If you want a forum I would choose PHP, for the open-source community has many nice freeware to open-source forum scripts already configured to the point where all you have to do is do the "administration" work, which can take half an hour to half a day depending on the complexities of your website, and what you choose to go with. I had a forum up, and I believe I used PHPB, which they have a development driven community that updates functionality, scripts, themes, etc... so I would at least look at it, for it couldn't hurt. http://www.phpbb.com/ Also how familiar are you with PHP? You can use some tools like Eclipse http://www.poweredbypulse.com/ A place where you can grab and configure elcipse as you see fit, and later download it on another machine and just download your packages. Good for mobility. XAMP http://www.apachefriends.org/en/xampp-windows.html and you can start working with specific tools made for PHP and see if you interested in continuing. I hope I don't get too criticized for this part, but depending on what your familiarities are have you considered using ASP.Net, so you could use your favorite .Net language? I use ASP MVC and it's wonderful! Having a web development background I must also ask. How big, complex do you see this website becoming? Design is important, and if it becomes too big for a weekend project have you thought about having a CMS (content management system), so once the website is fully completed you can easily update it? just a thought... Good luck with this Kudos to you for starting, and post a link on the forums when it's done, for I'd like to see how it turned out.
  15. I figured it out. I didn't realize when I try to open a port I needed to give it a try catch, so when the port doesn't exist, or can't be open I can just catch the error and return instead of having the debugger spit out a non-existing object reference error, or whatever it spit out. The final code is below thanks for the help. private bool IsPortOpen(String portName) { SerialPort tempPort; try { tempPort = new SerialPort(portName); try { tempPort.Open(); } catch { return false; } tempPort.Close(); return true; } catch { return false; } } Again thank you! Much help it was looking at it that way.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!