• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Jakob Krarup

Members
  • Content count

    14
  • Joined

  • Last visited

Community Reputation

159 Neutral

About Jakob Krarup

  • Rank
    Member

Personal Information

  1. Do you only have a single SpriteBatch.Begin before and a single SpriteBatch.End after your drawing? Having many separate spritebatches with the begin/end will slow your drawing down a lot.
  2. Hi Shippou You could fiddle a bit with the chunk sizes, to ensure that you would only read/dump files from and to disk every so often. If your maps are pretty simple, the amount of data in memory shouldn't be a problem. To my knowledge this is the same way Minecraft does it. You could also cache a bigger amount of chunks, say two concentric circles worth around the one the player is currently in. I can't see this becoming a problem on modern computers. Try the sample that's for download on my Blog - I haven't experienced any problems, and the chunks there are very small, to illustrate the concept. If you make 255x255 chunks you would load a lot less and the files would still be fast to read and not too much of a strain on memory. Kind regards - Jakob
  3. Hi Mellkor A similar question popped up on the Microsoft XNA forums a while back, and I posted some graphics to visualize the theory and a code sample with class diagram. (scroll down to "I found some time yesterday, and coded a framework for making infinite worlds.")   I hope it will prove useful to you    Kind regards - Jakob
  4. Yup - they are now :) Nice game! The gfx for the menu and introscreen is very nice. I like the concept, but I don't get the feeling that what I do changes very much in the game. If I move in a different direction all the small enemies quickly catch up to me, and the big enemy is very hard to outmaneuver. I would like small explosions as well when I hit or when I am hit, so I get the reward (feedback) for aiming well. A little sound for each shot being fired would be nice too.   Overall a very good first game! :)   Kind regards - Jakob
  5. Glad to hear it! :) Cudos on coming back with your solution for future reference :)   /Jake
  6. The links are down. Maybe it has to do with DropBox having trouble, but otherwise, if you could upload again? :)
  7. Hi Dobbydoo It sounds like there are two different tasks here:   1) Getting the mouse's position relative to the parent object (where you want the childobject attached, right?). 2) Drawing the child object in-game while being able to rotate its position and Texture.     Solving 1 is pretty simple:   To get direction from object to mouse as a Vector2, subtract object's position (a Vector2) from mouse's position (also a Vector2):   Vector2 distanceAndDirectionFromObjectToMouse = mousePosition - objectPosition;   This value you can store along with the child object, to know where to draw it in relation to the parent.   Solving 2) is more complicated. You want to be able to rotate the child object's position around the parent. To do this you need to: Find the current rotation of and distance to the child object change the rotation by the wanted amount calculate the new position using cos and sin (you may want to read up on these) basically cos(angle) gives you the X coordinate of where to position something, and sin(angle) gives you the Y coordinate. Getting the rotation of a Vector2 is possible using the Atan2 function:   private float Vector2ToRadian(Vector2 direction) {     return (float)Math.Atan2(direction.X, -direction.Y); }   Radian is  a type of measurement where there are 2 * PI degrees (approximately 6.283) around the full circumference of the circle as opposed to regular degrees where you have 360.   Getting the distance is a method on the Vector2 struct called Length().   float distanceToChild = distanceAndDirectionFromObjectToMouse.Length();   using the distance and rotation you can use the following method to find the new location of the child object (the "sattelite" in the methodname below):   public Vector2 GetPositionOfSatellite(Vector2 center, float distance, float directionInRadians)   {           float yDifference = (float)Math.Sin(directionInRadians);           float xDifference = (float)Math.Cos(directionInRadians);           Vector2 direction = new Vector2(xDifference, yDifference);           Vector2 precisePositionOfSatellite = center + direction * distance;           return precisePositionOfSatellite;       }    If that is unclear, you may benefit from the two articles I've taken code from:   http://xnafan.net/2012/12/pointing-and-moving-towards-a-target-in-xna-2d/ http://xboxforums.create.msdn.com/forums/p/112011/670251.aspx#670251   ...otherwise, just ask   Kind regards - Jakob
  8. Hi :)   Here you can download codesamples for reading a map from a textfile. http://xnafan.net/2013/01/2d-map-generation-for-xna/   This code uses numeric values, but you can change what you do with the characters read to a SWITCH statement like you are mentioning in your question.   Kind regards - Jakob
  9. I hope it is okay to post a link to my own blog, as long as it has useful content?    I've been working on www.xnafan.net for a couple of years, and am open for suggestions for tutorials you would like to see :).   Kind regards - Jakob
  10. Here's a code framework for infinite worlds implemented in XNA: http://xboxforums.create.msdn.com/forums/p/111091/664227.aspx#664227   You would have to make an implementation of IPermanentMapStorage which gets maps from a webservice.  You can probably use the rest of the code as is   /Jake   P.S. in case you are interested in seeing the newest version, which uses Perlin noise for map generation (not a requirement for the framework), it is attached to this post.
  11. Cool :)   Good luck!   /Jake
  12. Hi tmccolgan88     What you need is a "camera". And I put "camera" in quotation marks, because it is merely a way of thinking about the concept. Whenever you are drawing the background, you are using the absolute coordinates, which makes them stay where they are, and your player move, as you point out. What you are looking for is a way to "translate the coordinates of the world into the screen, based on the player's position". This can be done by storing a Vector2 (yes - you may call it "_camera", to keep up the illusion that there *is* a real camera ;)), and updating the value of that vector based on the player's movements. Whenever you want to draw the background (world), you subtract the position of the camera from the position of the tiles/map-pieces/whatever, to make it the new origin for coordinates (it will be the top-left corner of the screen).   Does that make sense?  Otherwise Google "2D camera" or ask again   Kind regards - Jakob
  13. Hi Burnt_casadilla   You can change the line:   builder.Append(separator + (map[x, y] > oceanLevel ? "X" : " ")); to   builder.Append(separator + map[x, y]);     This will look up the value in the double array at position x,y and add that to the StringBuilders buffer for later retrieval. EDIT: I added an extended version of the editor to the blogpost (at the bottom), which supports saving the heightmap (and you can look at the code for loading from the file as well, though the application doesn't support it).   as for adding a border - you can do this with a for-loop, iterating through zero to max on both the Y and X axis, and setting the value there to 50 if either the X or the Y value is either zero or max.   If that doesn't make sense, ask again   Kind regards - Jakob Krarup ;-)
  14. Hi Manhattanisgr8 :)    I am currently making a tutorial on how to code a snake game in XNA, so you're welcome to have my code so far to look at for inspiration. I've chosen the List<Point> implementation, and then just drawing the List[0] part as a different texture to show the head.   Here's the code, and here's a screendump of the game so far:     Let me know if any of it gives you any trouble :)   Kind regards - Jakob