1. Past hour
2. ## Quick lane-changing movement of player object

An alternative is to swap "lane" and "toLane", although that changes the "current lane", which may not be desirable.
3. ## Roadmap to GameEngine development

I propose a slightly different approach: 1. Start by making one object (of any kind, eg. a cube) that exists in the world, can be displayed, and can react to user input in some way. 2. Think of a game, or a type of game, which you would like your engine to support. 3. Think of the most important feature of that game that your engine does not have. 4. Implement that feature. 5. GOTO 3 until you end up making that game using your engine. 6. GOTO 2 until you end up with a general-purpose engine. I think this order makes the most sense. It focuses on questions that you can easily answer ("What do I want to do? What do i need to do it? What do I not have from the things I need?") and you will end up with a logical order of features and a better sense of progress than trying to order features in a vacuum.
4. ## PythonSet up OpenGL 3 for Python

You need to type commands in the console terminal (you need to run the console terminal as administrator): pip install GLFW pip install PyOpenGL pip install Pyrr pip install NumPy Pyrr - for trigonometry and linear algebra NumPy - for special arrays for OpenGL functions You will see how to use these libraries in video tutorial below. Now you are ready to create simple games in Python and OpenGL. See this video tutorial about basics of OpenGL. You can start from the second lesson: Modern OpenGL programming in Python - part 02 - creating a GLFW window After studying of this tutorial you can rewrite a prototype of the Snake 2D Tutorial: Python Snake Game from deprecated/legacy OpenGL 1 to modern OpenGL 3 and make it 3D with textures and lighting. And you will be able to load 3D models from Blender because the video tutorial above covers loading 3D models from Blender. How to create an empty window using GLFW: Copy the file below ("main.py") Place glfw3.dll (glfw3.dll.zip) with "main.py" Run the application. For this run the command in the console terminal: python main.py main.py import glfw def main(): # Initialize glfw if not glfw.init(): return window = glfw.create_window(800, 600, "My OpenGL Window", None, None) if not window: glfw.terminate() return glfw.make_context_current(window) while not glfw.window_should_close(window): glfw.poll_events() glfw.swap_buffers(window) glfw.terminate() if __name__ == "__main__": main()
5. ## Appropriate questions to ask in interview

Yeah I know but so far, with my luck, they're the only company that responded back. Yeah you know my last in person interview was with appliedVR for an Android developer position. In that interview, I did an outstanding job showing them my stuff and know how. What happened was that it turns out that I didn't get the job because I didn't have sufficient actual work experience. If I did they would have hired me on the spot. That's also why I'm not be so picky about jobs.
6. ## Alternative names for fantasy classes

Sometimes it is good to use standard names for things. Using standard names for classes makes it easier for players to learn what each class does. Using new names makes the learning curve longer (for the same standard classes), and all you get in return is some originality (but not much, if the classes are still standard in everything except their names). You should think about if that trade-off is worth it.
7. ## Options/Advice for Selling Mod on Open-Source Game?

There is also a (at least one) multiplayer AI-writing RTS: Screeps Interestingly, they are making money by selling CPU time for your AI.
8. Today
9. ## Pygame - alternatives?

You mention vsync, which would suggest you're talking about tearing. But the problem you describe sounds more like the problem of using float positions, which is a different issue. That would be avoided by using only integer positions. If you're talking about actual tearing though (when the top and bottom halves of the screen are in different positions), apparently Pyglet is better for preventing that. It's true that mimicking the refresh display can minimize tearing, but it's not possible to time everything exactly as you propose. Plus, it's very possible for someone to have a different refresh rate, e.g. 59 Hz is one I've seen in some computers I've used, so it's not a 100% reliable solution anyway.
10. ## Quick lane-changing movement of player object

Here's a fairly simple approach I would use: 1) at all times, the player belongs to a "lane". This can be a separate object, and index or just a vector you store in the player object. 2) the player also has a property called "toLane", which is nothing more than a reference another lane. Most of the time this can be some invalid/null value to denote that the player is staying in the current lane 3) when a lane change needs to happen, set the "toLane" to the target lane and start a timer (you may also want to set the speed of the transition)* 4) while the transition is in progress (eg while the timer is less than the desired transition time), lerp the position from "lane" to "toLane" (keep the transition relative to ensure the player can keep moving along the road in the interim) 5) once the lane change finishes, set "lane" to "toLane" and "toLane" to invalid/null * I'm not sure what code you're working with. 'Starting a timer' in this case might be something as simple as adding the player to a list of animated objects where the lane change is applied automatically. This list is then processed every tick until the animation completes and the objects are removed. If you wish to allow the player to be able to undo the lane change by letting them navigate back mid-transition, simply set "toLane" to "lane", set the "lane" property to invalid/null, and treat the player's world position as the source point. Based on your example this seems to have the chance of becoming complicated quickly, however. Unless you provide additional metadata along with the level. Eg what do you do if the player wants to change lanes while in the middle of an intersection?

12. ## My Footsteps Sound Effects !

That sounds awesome ! Contact me any time. And the offer for a discount on my sound effects on ogsoundfx.com still stands. Maybe next time
13. ## Dev Diary #007 - Indie Inc.

Hi, and welcome to this weeks Dev Diary! This last week was entirely on video editing, as I spent all my time on creating the first release version of the Intro Video for Project Taival. Secondly, I have spent time on researching about building a Indie Game company around my first game. You would think that you can't have a Game Company while being an Indie Game developer, but I found a method how that can still be true, while at the same time being more organized with other Indie game developers. More on that down below. Intro Video (Picture: Preview of the latest iteration of the 9th iteration of the Intro Video) During all this time editing the intro video, despite being 10 seconds long (600 frames, at 60fps), I have constant problems with my PC's capability to handle the workload, as many time After Effects freezes due to low amount of RAM (8Gb). This can be mitigated largely by urging the caches often, but when ever I forgot to do so multiple times when previewing the footage, some work has been lost and needed to be done again. Secondly, my 9 years old, 6 core CPU (AMD Phenom 2 1060T) isn't up for the task anymore. Luckily I decided back then to go for a 6 core CPU, even though many review sites touted that it was a waste of money back then (2010), as almost all games only used 1 or 2 cores. If I didn't have 6 cores now, I can only dread at how slow my PC would be now. Due to the age of my PC, the preview speed in After Effects is only a fraction of a frame per second, approximately 1 frame every 3 seconds, when the text layer is enabled . This slows down even the most simple workflow considerably, which is why making a simple 10 second Intro #Video has taken so long. As I'm still just learning how to use After Effects properly, I do many small changes and like to see how they affected the end result, which takes time to see properly. The odd thing is, that the GPU acceleration is enabled, but somehow my PC processes the preview extremely slowly, which is odd to say the least. I have a Geforce GTX 1080 Ti GPU, so it shouldn't be because of a slow card for the job. Ideas for a Games Company Since simple research into company structures is so easy these days, I see no harm in sharing the rudimentary concepts of the ideas I came across for anyone interested. Considering how bad the situation has become in the games industry, as all the largest game companies seem to be headed in to a quantity before quality approach in their games. Most visible example being EA having predatory and borderline predatory micro-transactions in their games and other games companies, like Bethesda following on their tracks with Fallout 76. I have come to believe that a Co-Op model would be the best practice for a games company, as that makes corporate takeovers by behemoths like EA much less likely to happen and keeps the company responsible for their customers in a healthy manner. Thus, those who want to enter the gaming industry to create something remarkable, something that speaks to players in a whole different level than the mass produced husks of ideas of past glory, have a place to do so. As for the Indie developers, a Co-Op can function as a umbrella company for individual game developers, where independent developers do their own games the way they are used to do them. The Co-Op can provide the following benefits; For Developers; - Various Tax benefits (Potential savings in the first 5 years measured in a range of or more than 1k - 20k USD per year). - Security in numbers, which helps all participants to protect their IP's - The developer owns the IP, if the Co-Op has agreed so. For Gamers; - Much better likelihood for quality games, with more creative or experimental core concepts. - Much more incentives for customers (gamers) to build and upkeep a healthy community around the company and it's philosophy. (if the co-op decides to implement such factors). Remember that a regular corporation model can do the same things, but since a Co-Op is much more resilient towards corporate takeovers, a Co-Op harbors more trust and gives a notion of longevity and sincerity of the company. A Co-Op can include customers in the company ecosystem in a more integral way, thus encouraging customer loyalty. Taking care of the company bottom line by keeping the source of your revenue - the customers - happy, in a win-win fashion, is a healthy business decision by any measure. I won't go into details on how to achieve all this, as that is between me and those who would like to build something like this with me. In Finland, it is possible to found a Co-Op by my self also, which I might do before finding partners, as it is a good idea to think hard on who you want to partner up with. This is it for this weeks Dev Diary, thank you for tuning in and welcome again next week!
14. ## undefined behavior of bullet objects.

I guess than i have to do it by hard way😵 as Alberth suggested, So thanks for both of your replies and help😄.
15. ## undefined behavior of bullet objects.

If you are sure you can confirm it is not tunneling (you've tried continuous collision detection, you are sure of your stepping etc), then you will probably need to use detective work as Alberth suggests, I agree with the advice on using simple tests.

Nice one!
17. ## Improbable's SpatialOS GDK for Unity

Maybe when there is some more direct and simple explanation about what this really is, and there is pricing info people will start using this. I see ads everywhere but I still haven't found a good and simple explanation of what SpatialOS is. And I don't want them to contact me just to try the thing.
18. ## c# console snake game

Let's structure the code a little bit. I think it is more convenient to separate drawing and action. This code is just for example. The code below is bad because the snake changes a move direction with changing a food position. Could you explain how do you want to control the snake? By mouse click? Or the snake must move yourself with simple AI (path finding)? int food_x = 0; int food_y = 0; private void timer2_Tick(object sender, EventArgs e) { move = rnd.Next(1, 5); food_x = rnd.Next(0, 200); food_y = rnd.Next(0, 200); } private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = this.CreateGraphics(); SolidBrush greenBrush = new SolidBrush(Color.Green); SolidBrush blackBrush = new SolidBrush(Color.Black); SolidBrush redBrush = new SolidBru﻿sh(Color.Red); //Rectangle rect_green = new Rectangle(340 + x, 280 + y, 10, 10); //Rectangle rect_black = new Rectangle(330 + x, 280 + y, 10, 10); Rectangle rect_green = new Rectangle(150 + x, 150 + y, 10, 10); Rectangle rect_black = new Rectangle(140 + x, 150 + y, 10, 10); Rectangle rect_red = new Rectangle(food_x, food_y, 10, 10); g.FillRectangle(greenBrush, rect_green); g.FillRectangle(blackBrush, rect_black); g.FillRectangle(redBrush, rect_red); redBrush.Dispose(); blackBrush.Dispose(); greenBrush.Dispose(); g.Dispose(); }
19. ## undefined behavior of bullet objects.

i tried decreasing down the ball's velocity it is not working.
20. ## What happened to the rasterization stage? I can't even draw a triangle!

@ajmiles will be right, I also bumped into this.
21. ## Game concept and tools required question

Thanks Lorenzo - I've downloaded Unity and am going through a load of tutorials and such to get my head around the engine. Looks pretty in-depth, so will likely take a while to truly get to grips with it, but looking forward to the challenge! Thanks again for your help
22. ## Game concept and tools required question

Technically, your needs are generic (point and click interaction, probably keyboard, rendering layers of assorted animated stuff) and not very demanding (2D, not realtime), so generic tools like Unity and other popular engines should be fine. Regarding selection of the best one, the only obvious thing that could require an in-depth analysis is how to implement modding with that engine. Everything else you mention is strictly a game design challenge and you won't need special tools to start thinking about them.

24. ## C# Quick lane-changing movement of player object

In the attached picture an intersection block is shown. My goal is to have the player switch lanes and (within the red bounding box) turn direction on a different road while always keeping a forward movement. Therefor the only input is left and right. The changing of the lanes has to happen quick and snappy (dependant on the player's overall speed) as visualized by the black squigly line. However I'm not sure how to implement this. I tried moving left and right with coroutines but got stuck at going back to the lane one came from mid-changing. I added those nodes at the ends with the intention to lerp/move towards depending on the lane and road the player changes to but that won't work with the aforementioned quick snappy movement. Another thought that passed was creating a bit of a node graph and dynamically make a spline when switching lanes but this seems a bit overkill for what it really is (?). Finally I figured creating an object that the player controls but doesn't see that the actual player objects follows that's slightly infront of the object but haven't gotten to that yet due to too much doubts of implementation. The player should not be constrained. If they whish to change back to a lane halfways through changing lanes that should be possible. Would like to hear some suggestions no mather how out there they might seem. Thanks!
25. ## In a Pixel Shader, how to get uninterpolated pixel coordinates near some vertex

I also wanted to add: what is happening in the video before (when there were white dots inside the triangles) I explain as a mistake of "Float Point Error" when interpolating in the Rasterizer.
26. ## Game audio production milestones

Thanks for the reply. I wasn't entirely clear with my question. I'd like to know what major deadlines are there in audio production? What major deadlines do pre-production, production and post-production have, and what tasks belong to each of these major deadlines? Thank you.
27. ## In a Pixel Shader, how to get uninterpolated pixel coordinates near some vertex

Your method works fine. And I even checked it now. Everything is normal, but there is a problem that you compare not with the actual coordinates of the pixel, but with some abstract value, which is not quite correct. It looks like a bit of a crutch, but most likely I would have done the same in the end if I had not found another solution. I wanted to first find the settings for disabling this interpolation and thought that it could not be that they are not there. It is good that I did not give up on this and finally decided to ask on the forum. Even, before the question here, I discovered earlier that, for example, DirectX 12 (HLSL 5.1) has more features when accessing the settings of the Rasterizer. Thus, the version of the API also depends, and not what Irusan, son of Arusan (my thanks to him again!) wrote, that there is no difference. I also checked that changing the settings of the Rasterizer: rasterDesc.FrontCounterClockwise = true; rasterDesc.CullMode = D3D11_CULL_BACK; // or rasterDesc.FrontCounterClockwise = false; rasterDesc.CullMode = D3D11_CULL_FRONT; does not change the order in which it interpolates the values. Thank.

29. ## DevBlog #34

Thanks In fact, this scale in the game will not. With this removal of the camera, the map will switch to strategic 2D mode. Therefore, there is no sense in Imposters.
30. ## undefined behavior of bullet objects.

Thanks lawnjelly, I have gone through the post you mentioned. But I am not sure that this is the problem with my simulation because that particular sphere also fails the raytest. As I know raytest don't need time stamp to calculate the collision between the object and ray cause bullet and other physics engine checks collision when all the object are static at any instant. And also the size too is big. Although i will try to make it clear by reducing the velocity of the balls and then check it again and let you know
31. ## That's it

Still some rough edges and lots more that could be done, but it's essentially finished. You can restart a game, see the score and the snake can get much longer (a trivial change). This hasn't really been a blog, but somewhere to drop this code. Maybe I'll make another one that goes through it step by step (because although console is obviously not for gaming, a lot of the basics can be learned from a project like this). Another idea would be to make a blog about turning this exact code into a graphics (e.g. GDI) version with a minimum of changes... That would be geared more towards beginner C# programmers. If anyone's interested using System; using System.Linq; using System.Threading.Tasks; namespace ConsoleSnake { /// <summary> /// All code written by duke_meister (Valentino Rossi) /// except keyboard reading technique /// </summary> class Program { // our unchanging values: // playfield height & width const int PlayfieldWidth = 80; const int PlayfieldHeight = 40; // game pieces const string EmptyCell = " "; const string SnakeHeadCell = "@"; const string SnakeBodyCell = "o"; const string FoodCell = "."; // timeout to adjust speed of snake static int MillisecondsTimeout = 50; // our playfield; stores FieldVals instead of ints so we don't have to remember them static readonly FieldVals[,] PlayField = new FieldVals[PlayfieldWidth, PlayfieldHeight]; static int _snakeBodyLen; // not including head // which direction (SnakdDirs enum) the snake is currently moving static SnakeDirs _snakeDir; // position of the one-and-only piece of food; use our own coordinate class, Pos static readonly Pos FoodPos = new Pos(0, 0); static readonly Pos EraserPos = new Pos(0, 0); // defines the snake; each element tells us which coordinates each snake piece is at static int _maxSnakeLen = 30; static Pos[] _snakeCells = new Pos[_maxSnakeLen]; // guess static int _score = 0; // for randomizing things like food placement static Random _rnd; // how many body pieces the snake will increase by when it eats food static int SnakeSizeIncrease = 2; // could've used something existing, but made a simple screen coordinate class public class Pos { public int X { get; set; } public int Y { get; set; } public Pos(int x, int y) { X = x; Y = y; } } // these make it easy (for the human) to know what each cell contains enum FieldVals { DontDraw, Empty, SnakeHead, SnakeBody, SnakeFood } // these make it easy (for the human) to read snake the direction enum SnakeDirs { Up, Right, Down, Left } static void Main(string[] args) { _rnd = new Random(); RunGame(); } private static void RunGame() { Console.Clear(); _score = 0; for (var i = 0; i < PlayfieldWidth; i++) { for (var j = 0; j < PlayfieldHeight; j++) { PlayField[i, j] = FieldVals.DontDraw; } } // create the initial snake cell coords (place it on playfield) SetUpSnake(); // start with an initial piece of food MakeNewFood(); // draw the border, once DrawBorder(); // game loop; this was the easiest but might switch to Timer, etc. // function names should explain purpose for (;/* ever */; ) { CheckForKeyboardCommand(); AdjustGameSpeed(); UpdatePlayfield(); CheckForSnakeOutOfBounds(); CheckForSnakeCollisionWithSelf(); UpdateSnakeBodyPosition(); CheckSnakeHasEatenFood(); } } private static void CheckForSnakeCollisionWithSelf() { if( _snakeCells.Skip(1).Any(pos => pos.X == _snakeCells.First().X && pos.Y == _snakeCells.First().Y)) { EndGame(false); } } /// <summary> /// Work out the initial coordinates of the snake's body parts /// </summary> private static void SetUpSnake() { _snakeBodyLen = 4; // create the empty snake array cells for (var i = 0; i < _snakeCells.Length; i++) { _snakeCells[i] = new Pos(0, 0); } // randomly choose snake's initial direction _snakeDir = (SnakeDirs)_rnd.Next((int)SnakeDirs.Up, (int)SnakeDirs.Left + 1); int[] xOffsets = { 0, _snakeBodyLen * -1, 0, _snakeBodyLen}; int[] yOffsets = { _snakeBodyLen, 0, _snakeBodyLen * -1, 0}; int xOffset = xOffsets[(int) _snakeDir]; int yOffset = yOffsets[(int) _snakeDir]; // First randomly choose the position of the snake's head // We'll work out the rest of the snake body coords based on which // direction it's initially facing. _snakeCells.First().X = _rnd.Next( xOffset * _snakeBodyLen * -1, PlayfieldWidth + xOffset * _snakeBodyLen + 1); _snakeCells.First().Y = _rnd.Next( yOffset * _snakeBodyLen * -1, PlayfieldHeight + yOffset * _snakeBodyLen + 1); switch (_snakeDir) { case SnakeDirs.Up: // make the snake's body go below the head, as it's moving up for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X; _snakeCells[i].Y = _snakeCells[i - 1].Y + 1; } break; case SnakeDirs.Right: // make the snake's body go left of the head, as it's moving right for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X - 1; _snakeCells[i].Y = _snakeCells.First().Y; } break; case SnakeDirs.Down: // make the snake's body go above of the head, as it's moving down for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X; _snakeCells[i].Y = _snakeCells[i - 1].Y - 1; } break; case SnakeDirs.Left: // make the snake's body go right of the head, as it's moving left for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X + 1; _snakeCells[i].Y = _snakeCells.First().Y; } break; } } private static void AdjustGameSpeed() { // delay so the game isn't too fast. Halve the delay (to go faster) when going left or right // as it appears that going up/down is faster Task.Delay( _snakeDir == SnakeDirs.Up || _snakeDir == SnakeDirs.Right ? MillisecondsTimeout / 2 : MillisecondsTimeout).Wait(); } /// <summary> /// Check the keyboard for arrow keys /// I got the code off the net (see bottom of code); no point re-creating this /// </summary> private static void CheckForKeyboardCommand() { if (NativeKeyboard.IsKeyDown(KeyCode.Down)) // player hit Down arrow { // can't hit down while going up; game over if (_snakeDir == SnakeDirs.Up) EndGame(false); // change snake direction to down _snakeDir = SnakeDirs.Down; } else if (NativeKeyboard.IsKeyDown(KeyCode.Up)) { // can't hit up while going down; game over if (_snakeDir == SnakeDirs.Down) EndGame(false); // change snake direction to up _snakeDir = SnakeDirs.Up; } else if (NativeKeyboard.IsKeyDown(KeyCode.Left)) { // can't hit left while going right; game over if (_snakeDir == SnakeDirs.Right) EndGame(false); // change snake direction to left _snakeDir = SnakeDirs.Left; } else if (NativeKeyboard.IsKeyDown(KeyCode.Right)) { // can't hit right while going left; game over if (_snakeDir == SnakeDirs.Left) EndGame(false); // change snake direction to right _snakeDir = SnakeDirs.Right; } } /// <summary> /// See if snake has eaten the food /// </summary> private static void CheckSnakeHasEatenFood() { // if snake head is in the same x,y position as the food // NB: First() is a Linq function; it gives me the first element in the array if (_snakeCells.First().X == FoodPos.X && _snakeCells.First().Y == FoodPos.Y) { IncrementScore(); MakeNewFood(); IncreaseSnakeSize(); } } private static void IncreaseSnakeSize() { if (_snakeBodyLen + SnakeSizeIncrease <= _maxSnakeLen) { _snakeBodyLen += SnakeSizeIncrease; UpdateScore(); } } private static void UpdateScore() { WriteAt($"Score: {_score} Snake Size: {_snakeBodyLen}", 0, 0); } private static void IncrementScore() { ++_score; UpdateScore(); } /// <summary> /// Put food item at random location /// </summary> private static void MakeNewFood() { int x, y; do { // this ensures we're not putting the food on top of the snake, or the border x = _rnd.Next(1, PlayfieldWidth - 1); y = _rnd.Next(1, PlayfieldHeight - 1); } while (_snakeCells.Any(pos => pos.X == x || pos.Y == y)); // set the food coords FoodPos.X = x; FoodPos.Y = y; // update the playfield position with the food value PlayField[FoodPos.X, FoodPos.Y] = FieldVals.SnakeFood; } static void CheckForSnakeOutOfBounds() { // snake mustn't be on any border cell, or game over if (_snakeCells.First().Y < 1 || _snakeCells.First().X > PlayfieldWidth - 2 || _snakeCells.First().Y > PlayfieldHeight - 2 || _snakeCells.First().X < 1) { EndGame(false); } } /// <summary> /// Move the snake pieces appropriately. I just did the simplest thing that I thought of. /// </summary> static void UpdateSnakeBodyPosition() { // remember the position of the snake's last piece so that later, // after drawing the snake, we can set it to the 'don't draw' value EraserPos.X = _snakeCells[_snakeBodyLen].X; EraserPos.Y = _snakeCells[_snakeBodyLen].Y; // Last piece of snake's tail will always become empty as the snake moves // NB: Last() is a Linq function; it gives me the last element in the array (end of snake tail) PlayField[_snakeCells[_snakeBodyLen].X, _snakeCells[_snakeBodyLen].Y] = FieldVals.Empty; // move the 'middle' section of the snake one cell along for (int i = _snakeCells.Length - 1; i > 0; i--) { _snakeCells[i].X = _snakeCells[i - 1].X; _snakeCells[i].Y = _snakeCells[i - 1].Y; } // move the snake's head, depending on direction moving // the body was already moved above switch (_snakeDir) { case SnakeDirs.Up: // moved the snake head up 1 (-ve Y direction) --_snakeCells.First().Y; break; case SnakeDirs.Right: // moved the snake head right 1 (+ve X direction) ++_snakeCells.First().X; break; case SnakeDirs.Down: // moved the snake head up 1 (+ve Y direction) ++_snakeCells.First().Y; break; case SnakeDirs.Left: // moved the snake head left 1 (-ve X direction) --_snakeCells.First().X; break; } // Set the playfield position at the head of the snake, to be... the snake head! PlayField[_snakeCells.First().X, _snakeCells.First().Y] = FieldVals.SnakeHead; // Set the positions on the playfield for the snake body cells // so we know to draw them // NB: Skip(1).Take(4) is Linq; it gives me the array left after // skipping the first item, then grabbing the next 4 (so in this // case misses the first and last). foreach (var cell in _snakeCells.Skip(1).Take(4)) { PlayField[cell.X, cell.Y] = FieldVals.SnakeBody; } } /// <summary> /// Just show a message and exit (can only lose right now) /// </summary> /// <param name="win"></param> static void EndGame(bool win) { Console.Clear(); Console.WriteLine($"YOU DIED. Score: {_score} Snake Length: {_snakeBodyLen}"); Console.ReadKey(); Console.WriteLine("P to play again, Q to quit."); var consoleKeyInfo = Console.ReadKey(); if (consoleKeyInfo.Key == ConsoleKey.Q) { Environment.Exit(0); } RunGame(); } /// <summary> /// Set the console size appropriately & draw the border, leaving room for the score /// </summary> static void DrawBorder() { Console.SetWindowSize(PlayfieldWidth, PlayfieldHeight + 2); WriteAt("╔", 0, 1); WriteAt("╗", PlayfieldWidth - 1, 1); WriteAt("╚", 0, PlayfieldHeight); WriteAt("╝", PlayfieldWidth - 1, PlayfieldHeight); for (var i = 1; i < PlayfieldWidth - 1; i++) { WriteAt("═", i, 1); WriteAt("═", i, PlayfieldHeight); } for (var i = 2; i < PlayfieldHeight; i++) { WriteAt("║", 0, i); WriteAt("║", PlayfieldWidth - 1, i); } } /// <summary> /// Go through every element of the 2d array, only drawing a cell /// if it has a value (other than 0). This way we only draw the /// cells that need to be updated. A bit like Invalidate() in GDO. /// Pretty self-explanatory; if a cell has a value, draw the character /// appropriate for it. The space is only used to overwrite the last /// piece of the snake's tail. /// </summary> static void UpdatePlayfield() { for (var i = 1; i < PlayfieldWidth - 1; i++) { for (var j = 1; j < PlayfieldHeight - 1; j++) { switch (PlayField[i, j]) { case FieldVals.Empty: WriteAt( EmptyCell, i, j + 1); break; case FieldVals.SnakeHead: WriteAt(SnakeHeadCell, i, j + 1); break; case FieldVals.SnakeBody: WriteAt(SnakeBodyCell, i, j + 1); break; case FieldVals.SnakeFood: WriteAt(FoodCell, i, j + 1); PlayField[FoodPos.X, FoodPos.Y] = FieldVals.DontDraw; break; } } } PlayField[EraserPos.X, EraserPos.Y] = FieldVals.DontDraw; } // From Microsoft sample protected static void WriteAt(string s, int x, int y) { try { Console.SetCursorPosition(x, y); Console.Write(s); } catch (ArgumentOutOfRangeException e) { Console.Clear(); Console.WriteLine(e.Message); } } } /// <summary> /// Codes representing keyboard keys. /// </summary> /// <remarks> /// Key code documentation: /// http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx /// </remarks> internal enum KeyCode { Left = 0x25, Up, Right, Down } /// <summary> /// Provides keyboard access. /// </summary> internal static class NativeKeyboard { /// <summary> /// A positional bit flag indicating the part of a key state denoting /// key pressed. /// </summary> const int KeyPressed = 0x8000; /// <summary> /// Returns a value indicating if a given key is pressed. /// </summary> /// <param name="key">The key to check.</param> /// <returns> /// <c>true</c> if the key is pressed, otherwise <c>false</c>. /// </returns> public static bool IsKeyDown(KeyCode key) { return (GetKeyState((int)key) & KeyPressed) != 0; } /// <summary> /// Gets the key state of a key. /// </summary> /// <param name="key">Virtual-key code for key.</param> /// <returns>The state of the key.</returns> [System.Runtime.InteropServices.DllImport("user32.dll")] static extern short GetKeyState(int key); } }
32. ## C#GUI WinForms + OpenGL 3.1

This my example how to use GUI WinForms and OpenTK.GLControl Source for Visual Studio (including DLLs): EditedTriangle_WinFormsOpenGL31CSharp.zip EXE: EditedTrianlge_WinFormsOpenGL31CSharp_EXE.zip Separated DLL's for references: OpenTK.zip, OpenTK.GLControl.zip Standard WinForms Color Dialog:
33. ## Some reviews for your game!

Hi there! We are looking for people to play our game prototype Project BlockchainZ. Right now, we are available on itch.io for free and we really appreciate if you could give it a try! So, this is the link: https://projectblockchainz.itch.io/projectbcz Feel free to play the game and so to participate in our Discord Server. We are reaching a group of people to discuss about the game in order to create together an amazing video game! Thanks in advance
34. ## My Footsteps Sound Effects !

Very nice work. I see your music is being used to promote different industries which is really cool. I wasn't able to use any of your packs for my challenge game on GameDev.net here, as I didn't have enough time to finish... My commercial game will be needing assets at some point either way and I'll note down that you do music as well as I might need a composer if I don't do it in house.
35. ## Point light

mvVertexPosition = vec3(modelViewM﻿atrix * vec4(positions, 1.0));﻿﻿ . . . vec4 lightResult = calculateLight(pointLight, material, mvVertexPosition, mvVertexNormal); You are applying the view matrix to the position of the vertices, so as the view matrix changes, the light will change... I think.
36. ## what are capabilities and limitations of unreal engine blueprint

Someone did for C# something similar that was inspired by Unreal Engine name Netprints I think someone with some time would be able to port this into Unity and write some kind of C# code generator for it
37. ## A Low requeriments Engine?

I had running a Unity installation on my old XP System for a long time. ATI 2600 HD Graphics, AMD APU, 2 GB RAM so everything is possible if you are willing to deal with huge load times
38. ## undefined behavior of bullet objects.

The problem is probably 'bullet tunneling'. Or in this case, if you are using bullet physics, you could call it 'bullet bullet tunneling'. :) https://www.aorensoftware.com/blog/2011/06/01/when-bullets-move-too-fast/
39. ## Quest for the Ban Hammer - Dungeon Challenge

This is probably the hardest of all the entries I've played! I was able to find the Ban Hammer!!! I found it a bit difficult because it was so easy to get knocked off, and sometimes you would jump on a platform but still die, ect... After playing for over 2 hours 😮 I just did my "speed run approach" instead of attacking, gathering, and marking my spots. I grabbed the yellow crystal for vision, nothing else... Then jumped like a mad man through the whole level searching out everything. I found all the glasses locations so I equipped it and dumped the yellow crystal as I had full vision now. Then I found the ban hammer and returned back home. Took under 5 minutes with a clean run once I knew where to go. Great job!
40. ## Pygame - alternatives?

Well the thing is, even if I use the "clock" functionality and try to make my code run at a stable 60 FPS, it sometimes has 59 FPS or 62 FPS or something like that. Apparently it's not possible to use VSync at all, neither on Linux nor on Windows. The code of the game itself is fast enough (without limitation it runs at 180 FPS or something like that), so that's not the reason here. Now the problem is, when there is a sprite moving smoothly from one side of the screen to the other (imagine a simple arcade-like game, nothing 3D or so), you will sometimes see it jitter around instead of floating smoothly one pixel at a time. And as far as I've read so far, there is no way to fix this when using Pygame, it simply has to be accepted.

43. ## The Great Tribes

Game project, a global strategy simulator of civilization development - The Great Tribes
44. ## OpenGL Point light

Hey guys, I'm having a little trouble with my point light. My light is working but the light source moves when I move my camera. I've been trying all week to fix it but at my wits end. Maybe I haven't converted it to the proper space. **VERTEX SHADER** in vec3 positions; in vec2 texCoords; in vec3 normals; out vec2 pass_texCoords; out vec3 mvVertexNormal; out vec3 mvVertexPosition; uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; uniform mat4 normalMatrix; void main() { pass_texCoords = texCoords; vec4 mvPos = modelViewMatrix * vec4(positions, 1.0); mvVertexNormal = mat3(normalMatrix) * normals; mvVertexPosition = vec3(modelViewMatrix * vec4(positions, 1.0)); gl_Position = projectionMatrix * mvPos; } **FRAGMENT SHADER** in vec2 pass_texCoords; in vec3 mvVertexPosition; in vec3 mvVertexNormal; out vec4 out_colour; struct Material { int hasNormalMap; int hasTexture; vec3 diffuse; vec3 ambient; vec3 specular; float reflectivity; }; struct PointLight { vec3 position; vec3 colour; float intensity; }; uniform sampler2D our_texture; uniform Material material; uniform vec3 ambientLight; uniform float specularPower; uniform PointLight pointLight; uniform vec3 viewer_position; vec4 calculateLight(PointLight light, Material material, vec3 position, vec3 normal) { // AMBIENT vec3 ambient = ambientLight * light.colour; // DIFFUSE vec3 norm = normalize(normal); vec3 lightDir = normalize(light.position - position); float diff = max(dot(norm, lightDir), 0.0); vec3 diffuse = diff * light.colour; // SPECULAR vec3 viewDir = normalize(viewer_position - position); vec3 reflectDir = reflect(-lightDir, norm); float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32); vec3 specular = specularPower * spec * light.colour; vec3 result = (ambient + diffuse + specular); return vec4(result, 1.0); } void main() { vec4 lightResult = calculateLight(pointLight, material, mvVertexPosition, mvVertexNormal); out_colour = texture(our_texture, pass_texCoords) * lightResult; } The light source is coming from the cube in the red circle. Even the first picture the light isnt directly under the cube. If I don't move my camera and have the cube light source move around automatically the the light will stay with it. It's only if I move the camera that I get problems. The second picture i've moved my camera to the left and the light is moving with me and moving away from the cube light source.

46. ## Psy - Dungeon Challenge

Wow really good take on this concept. I was able to get it on my 2nd try as I didn't know how to use potions (H).

48. ## Dawn - Dungeon Challenge

Great job! I really enjoyed this entry. Brought me back to the good ole' days!
49. ## c# console snake game

Paint gets called all the time. And you randomize the placement. That's why you get many all over the place. Also use e.Graphics
50. ## c# console snake game

Because you're randomly drawing it all over the screen... Well technically in the ranges of 330 - 340 + 0 - 770 and 280 + 0 - 550. What were you expecting random to do? Don't call the randomize function Form1_Paint() each frame and you won't get a new food items each frame.
51. ## Some questions about UDP in C++

• 0
• 0
• 0

• ### For Beginners

Public Group  ·  1 member

• ### GameDev Challenges

Open Group  ·  86 members

• ### Unreal Engine Users

Open Group  ·  4 members

• ### Optimization Strategy

Open Group  ·  1 member

• ### Publishing and Monetization

Open Group  ·  1 member

1. 1
2. 2
Rutin
27
3. 3
4. 4
5. 5

• ### Member Statistics

• Total Members
253970
• Most Online
6110