Jump to content
  • Advertisement

tburns517

Member
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

123 Neutral

About tburns517

  • Rank
    Member
  1. Hello all, I am student currently taking some college courses to learn game development. One assignment is to modify a game to include a few features such as collision detection. The instructor has provided the source code to use with our modifications, and I am having some trouble interpreting how I am supposed to use it with the code that is currently there. I have attached the game for those who are willing to help me sort this out. The source code provided starts on 651, and yes I am aware of the error on line 692, just unsure of where to start to make it work. To be completely honest, I am not fond of learning in this fashion, but I want to complete the assignment. Thanks in advance.
  2. tburns517

    ActionScript 3.0 issue

    I finally got it to work. All I had to do was go in and select the Embed options, then select All. I'm not sure why that is, but I'm glad it finally works. My next issue lies in the movie clip that controls the ship's energy. I currently have this within the checkCollision function:   if (barMeter.currentLabel == "start") { barMeter.currentLabel == "hit1"; } else if (barMeter.currentLabel == "hit1") { barMeter.currentLabel == "hit2"; } else if (barMeter.currentLabel == "hit2") { barMeter.currentLabel == "hit3"; } else if (barMeter.currentLabel == "hit3") { barMeter.currentLabel == "hit 4"; } else if (barMeter.currentLabel == "hit4") { barMeter.currentLabel == "hit5"; } else (barMeter.currentLabel == "hit5") { barMeter.currentLabel == "dead"; shipHit(); // destroy ship } When the game starts I set the currentLabel to "start" but that doesn't seem to do the trick. Am I doing this the wrong way? EDIT: I seem to be figuring out the problems as soon as I post them. I started using gotoAndStop, and that does the trick, however, the starting frame won't stay at the full meter, and it will just move back down to the original position. I'm not sure why this is.
  3. tburns517

    ActionScript 3.0 issue

    I believe I can share the code, if not, oh well.   For example with the score (if you are viewing the code), I create it starting on line 172. Disregard the other score creation, that is left for testing purposes. On line 187 is where the score updates. Below is some of the code I am working with in case you don't want to go in and view the files:   private var gameScore:Number; private var scoreMeter:ScoreMeter = new ScoreMeter(); public function createScoreDisplay() { addChild(scoreMeter); scoreMeter.x = 350; scoreMeter.y = 3; updateScore(); } public function updateScore() { scoreMeter.mcItem.txtAmount.text = String(gameScore); } EDIT: A few other things I am working on are fixing the mouse follower (doesn't fixate on the mouse when still) and collision detection, which I am having difficulty implementing. Any additional help would be greatly appreciated.
  4. tburns517

    ActionScript 3.0 issue

    Thank you Nypyren! That did the trick. Now I have another weird issue happening. The initial score meter will display the score going up by 100s. When the game starts, my added meter starts at 0 just like the original score meter. When I score, my meter changes to 00 while the original meter changes to 100. Any reason why it would be leaving the first digit out? It does it beyond 1000 as well.
  5. For a Flash Game Development course I am taking I am supposed to modify an Asteroids-type game. Our instructor has given us a lot of code to play around with, and I am currently working on including some meters to display the score, lives, level, and energy. The problem is, regardless of what I have tried, I cannot get the new meters to work with the game. The original scoring, lives, and level meters work, so I am not sure what the issue is. Here is what the instructions say that were also given to us: Note that each movie clip meter has a nested movie clip inside it.  The level, score, and lives meters have a text field movie clip object named 'mcItem'.  The dynamic text field resides within the mcItem movie clip; and it has its own name: txtAmount.  So, for example, to drive information to these meters, your code will look similar to this:   levelMeter.mcItem.txtAmount.text = 3; I am calling the movie clips, for example, as follows: private var livesMeter:LivesMeter = new LivesMeter();    Then going in and trying to use it: livesMeter.mcItem.txtAmount.text = 5; Doing multiple tests on this, it does not cooperate with the code. I've double checked all of the instances within the movie clip, and they all look correct. I feel like I must be missing something simple, any ideas?  
  6. tburns517

    Beginner Tasks

    Yes it is a college course, and the books we were given do not contain any code. The course goes over the security and software/system development life cycles, as well as what kind of threats are out there and the proper actions to take to help control these threats. It is an accelerated course that has only lasted 6 weeks. It does have pre-reqs that are programming courses, however, the programming assignments in these courses were not related to security. Honestly it is somewhat of a joke to me. If they hand us an assignment like this, the least they could do is give us a textbook that actually goes over how to implement it properly in code. Tispe, it does not say anything about graphics, and the sample given is a small offline game.
  7. tburns517

    Beginner Tasks

    I am taking a course in security at the moment, and although it did not require any programming before, I have been asked to do the following tasks for a final project:   Protect The game should allow users to logon on with a username and password. Store an artifact of the username and password on the computer. The user should not be able to easily manipulate the stored username and password. The users should not be able to read the usernames or passwords if you choose to store them as files. Track The game keeps a running score for each user. The game tracks user score and allows the user to continue the game the next time the user returns Log When a user starts a game: log their score, date, and time. When a user chooses to terminate their game: log their score, date, and time. Detect The game should detect if it is being manipulated. This modification will be tracking scores.  Detect if someone tries to start a game with a score different from when they last terminated the game. This modification will be tracking usernames and passwords.  Detect if someone is adding users or manipulating their passwords. React Upon detection of manipulation, the modification should announce it. Upon detection of manipulation, the modification should execute a pre-determined action such as clearing all scores. This course taught us more about the importance of security, and not exactly how to implement these specific tasks. I was wondering if you guys could direct me to some tutorials or provide some assistance as to how I should go about implementing these tasks. Thanks in advance.
  8. tburns517

    High Score class issues

    I feel I am making some headway here, and the code looks more efficient to me. The file right now is in bin\x86\debug, but it still does not write to the file. Do I need to be more specific on the location of the file when I read and write to it?   internal class HighScore { private int num; internal static bool onExit = false; internal void ReadHighScore() { string line; StreamReader file = new StreamReader(@"HighScore.txt"); if ((line = file.ReadLine()) != null) { num = int.Parse(line); Klax.highScore = num; } else { num = 0; } file.Close(); } internal void WriteHighScore() { ReadHighScore(); if (Klax.score > num) { using (StreamWriter newScore = new StreamWriter(@"HighScore.txt", false)) { newScore.WriteLine(Klax.score); } } } internal void Update() { if (PauseMenuScreen.quit == true) //This is suppposed to trigger the WriteHighScore function in the PauseMenuScreen class { //When the user quits, the score will be saved if it is higher than the previous high score WriteHighScore(); } }
  9. Hello, I am having some issues with saving the high score of a game. Can you guys tell me if there is something that looks wrong here? The main problem is that it is not saving the high score at all. Also, is there a way to read the high score from the existing file when the game starts up, and then set it to a variable so I can display it on the screen? The text file was added as an existing item to the game, it is in the same location as the Game.cs and Game.ico files. Thanks in advance.   internal class HighScore { private int number; internal static bool onExit = false; internal void ReadHighScore() { FileStream fileStream = File.OpenWrite("HighScore.txt"); TextReader textReader = new StreamReader(fileStream); number = textReader.Read(); textReader.Close(); } internal void WriteHighScore() { ReadHighScore(); if (number < Klax.score) { FileStream fileStream = File.OpenWrite("HighScore.txt"); TextWriter textWriter = new StreamWriter(fileStream); File.WriteAllText("HighScore.txt", String.Empty); textWriter.Write(Klax.score); textWriter.Flush(); textWriter.Close(); } } internal void Update() { if (PauseMenuScreen.quit == true) //This is suppposed to trigger the WriteHighScore function in the PauseMenuScreen class { //When the user quits, the score will be saved if it is higher than the previous high score WriteHighScore(); } } }  
  10. Here I am trying to implement the 3D lighting effect to code that we are supposed to work off of: private void DrawModel(Model m, Matrix world) { foreach (ModelMesh mesh in m.Meshes) { foreach (ModelMeshPart meshPart in mesh.MeshParts) { meshPart.Effect = Klax.effect; Klax.effect.View = Klax.View; //Error Klax.effect.Projection = Klax.Projection; Klax.effect.World = effect.World = world * Matrix.CreateRotationY(-.8f) * Matrix.CreateTranslation(16, 0, 0); } //foreach (BasicEffect effect in mesh.Effects) //{ // effect.EnableDefaultLighting(); // effect.DiffuseColor = _colors[ColorIndex].ToVector3(); // effect.View = Klax.View; // effect.Projection = Klax.Projection; // effect.World = world * Matrix.CreateRotationY(-.8f) * Matrix.CreateTranslation(16, 0, 0); //Move 3d off to side and rotate a little //} mesh.Draw(); } } I commented out what was previously there. The red underlined words are the errors. It says "Microsoft.Xna.Framework.Graphics.Effect does not contain a definition for *red underlined word* and no extension method *red underlined word* accepting a first argument of type Microsoft.Xna.Framework.Graphics.Effect could not be found (are you missing a using directive or an assembly reference?) Could anyone possibly explain what this means in simpler terms, and help me figure out what I need to do to fix this? Thanks in advance.  
  11. Since I haven't seen any replies yet, I will post some of the code here for quick viewing. Here is the start of my Particle class:   class Particle { public Vector2 position; public Vector2 velocity; public Vector2 acceleration; public float life; public const float timeBetweenFrames = 60f; List<Particle> particles = new List<Particle>(); SpriteBatch spriteBatch; internal void Initialize() { //Create a list of particles } //LoadContent() is in Klax class public void Update(GameTime gameTime) { velocity = velocity + acceleration * timeBetweenFrames; position = position + velocity * timeBetweenFrames; } public void Draw(GameTime gametime) { foreach (var particle in particles) { spriteBatch.Draw(Klax.smokeTexture, position, Color.White); } } } Pretty simple so far. What I would like to do is either have the smoke particles follow the blocks as they are falling, or follow the paddle (controlled by the user) left and right. I wanted to originally draw the effect after the blocks disappeared because of a match, but I am trying to take a more simple approach. Any tips you guys could give me? Note: The structure of this class was given to me to use.
  12. Hello, I am a beginner taking a course on XNA. I am working off of a Klax-like game project with the basic source code given to us to work off of. I have a few objectives that I need to complete this week: 1. Create a particle engine and add some particle effects to your game in 2D or 3D (Going the 2D approach). 2. Add lighting/material effects to your 3D models using shaders. 3. Implement a high score feature that is stored to the hard drive between games and displayed on the screen. After hours of staring at the project and making some progress, I have decided to ask for some help from you guys. Searching through countless tutorials and forums are not answering my questions to the specific areas I am having trouble in. I hope you do not mind downloading my project, as I do not want to post it all here and make it confusing: https://dl.dropboxusercontent.com/u/30197844/Klax.zip 1. Going off some tutorials, I have tried to replicate a particle engine. My main idea was to produce a cloud of smoke after the blocks are matched and removed from the screen. I am thinking of a way to make the implementation as easy as possible, but I am not exactly sure how. This is shown in the Particles and ParticleEngine classes, and I am thinking the effect could be drawn in the Grid class after they are removed(?) 2. I have not started this yet, but again I would like to find an easy way to implement this so I can understand it 3. I've spent countless hours trying to figure out what is going wrong. i have created a HighScore class which inherits the Game class so I can use the OnExiting function to check and see if the user has clicked the X button. This way, their high score will be saved if they either exit the window or quit the game through the pause screen. The classes used in combination are HighScore, PauseMenuScreen, and Klax. I can successfully quit the game, but once I start a new game it will not "load," and points to the Update method of the Klax class. I am not sure where I am going wrong here. If anyone would be kind enough to give me a hand in completing these objectives I would greatly appreciate it. I am trying to learn, but the structure of this project to work off of is pretty confusing to me at times. Like I stated, I would like to implement these objectives as simple as possible. I am not trying to "go all out" here, but trying to start small. Thanks in advance.
  13. tburns517

    Need Some Assistance with XNA

    For starters, here is what is currently in the Block class, which basically draws all of the blocks in the game. internal void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Klax.Texture, new Vector2(Column * Klax.ColumnWidth + Klax.ColumnOriginX, (int)Y), _colors[ColorIndex]); } My thought was that I should change it to Klax.myModel, which is the loaded in the Klax class, but I am a little lost on what else I need to do.
  14. tburns517

    Need Some Assistance with XNA

    I am usually hesitant to post for help in forums because the responses I receive are rude and unhelpful, but this forum does not come off that way. I was not sure how to post this, but here is the starting point project that I was given: https://dl.dropboxusercontent.com/u/30197844/Klax.zip This is week 4 of the course, so there are some things that I have done to it already, like the shader effect for example. What we need to do now is change all of the blocks to be 3D, and change the camera view after an event (such as a block hitting the paddle). In the Klax class, you can see I commented out my understanding of 3D and uses of the camera view as I was just playing around with the code. The program runs fine in 2D. My problem is now implementing 3D into the current game. Looking at the Block class, I am thinking of a way to change the Draw function so it draws myModel (defined in Klax class). I would also have to change the Draw functions in the other classes as well. Would this be the correct approach? I would appreciate any help you can give me, and if I posted the project incorrectly I apologize.
  15. tburns517

    Need Some Assistance with XNA

    Thanks for the link cozzie. I have viewed those tutorials, but my questions and trouble areas are more specific.
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!