• 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.

Ahmed Egyptian

Members
  • Content count

    32
  • Joined

  • Last visited

Community Reputation

137 Neutral

About Ahmed Egyptian

  • Rank
    Member
  1. I just don't need to use a tile map, and a basic centipede movement where I can place the nodes (pictures) with an offset between each node. 
  2. Thanks for the inputs.   I have initialized the nodes as follow. The gab can not be defined here, as whatever happens the node's prev position will be copied anyway. How would I set it ?  for (var i:int = 0; i < 5; i++) { var sprite:Node = new Node(); sprite.x = 100 + i * 90; sprite.y = 20; sprite.vx = -1; sprite.vy = 0; sprite.previousDirX = -1; m_nodes.push(sprite); addChild(m_nodes[i]); } Regarding the memorization technique, and the collision I have done that, it works but still a lot of flaws.   Is the algorithm correct ? if (m_nodes[0].x > 750) { delayCounter++; if (delayCounter == 1) { m_nodes[0].previousDirX = m_nodes[0].vx; } m_nodes[0].vx = 0; m_nodes[0].vy = 1; if (delayCounter > 2) { delayCounter = 0; trace("prev" + m_nodes[0].previousDirX); m_nodes[0].vx = -1 * m_nodes[0].previousDirX; m_nodes[0].vy = 0; } } } How did you ident your code that is posted here ? manually ?  
  3. I'm not using any tilemap, why should I use a tile map to let the sections not overlap ? the current problem is they are like this xxxx  instead of  x    x    x   x    x  x 
  4. Thank you so much!. will follow all things you mentioned.  I have another problem, which is setting an offset between the nodes, they are overlapping each other.
  5. Hi All,   I'm trying to set an offset for a snake or centipede nodes. I don't know the math behind it.  The centipede nodes follow the head, hence the position is copied.    I tried the following idea, but it didnt work for (var i:int = m_nodes.length - 1; i >= 0; --i) { if (i != 0) { /* m_nodes[i].x = m_nodes[i - 1].x; m_nodes[i].y = m_nodes[i - 1].y;*/ var currAngle:int = m_nodes[i].rotation + m_nodes[i-1].rotation; trace("curr Angle"+currAngle); m_nodes[i].x = m_nodes[i - 1].x + Math.cos(currAngle); m_nodes[i].y = m_nodes[i - 1].y + Math.sin(currAngle); } else { m_nodes[0].x += m_nodes[0].vx * (100) * dt; m_nodes[0].y += m_nodes[0].vy * (100) * dt; } }
  6. I debugged it a lot I still can't find where is the problem.  The space between the nodes can not be adjusted correctly relative to the speed and the collision also dismisses at a lot of cases :/
  7. I tried the following approach, but there are a lot of in correct logic.  I also would like to control the displacement between the nodes of the centipede. Kindly find the attached .swf, try to run it, also close it, then re-run it get it different mushrooms.  public function gameLoop(event:Event):void { var t:int = getTimer(); var dt:Number = (t - _t) * 0.001; _t = t; for (var i:int = m_nodes.length - 1; i >= 0; --i) { if (i != 0) { m_nodes[i].x = m_nodes[i - 1].x; m_nodes[i].y = m_nodes[i - 1].y; } else { m_nodes[0].x += m_nodes[0].vx * (100) * dt; m_nodes[0].y += m_nodes[0].vy * (100) * dt; } } for (var i:int = 0; i < m_nodes.length; i++) { var savedDir:int = m_nodes[i].vx; for (var b:int = 0; b < m_bricks.length - 1; b++) { if (m_nodes[0].hitTestObject(m_bricks[b])) { m_nodes[0].vx = 0; m_nodes[0].vy = 1; delayCounter++; if (delayCounter > 5) { delayCounter = 0; m_nodes[0].vx *= -1;  m_nodes[0].vy = 0; } } } if (m_nodes[0].x > 750) { m_nodes[0].vx = 0; m_nodes[0].vy = 1; delayCounter++; if (delayCounter > 5) { delayCounter = 0; m_nodes[0].vx = -1; m_nodes[0].vy = 0; } } else if (m_nodes[0].x < 40 && m_nodes[0].y < 500) { trace("x < "); m_nodes[0].vx = 0; m_nodes[0].vy = 1; delayCounter++; if (delayCounter > 5) { delayCounter = 0; m_nodes[0].vx = 1; m_nodes[0].vy = 0; } } if (m_nodes[0].y < 40 && m_nodes[0].x < 40) { trace("y <  x <"); m_nodes[0].vx = 0; m_nodes[0].vy = 1; delayCounter++; if (delayCounter > 5) { delayCounter = 0; m_nodes[0].vx = 5; m_nodes[0].vy = 0; } } else if (m_nodes[0].y > 560 && m_nodes[0].x > 40) { trace("y > x < "); m_nodes[0].vx = -1; m_nodes[0].vy = 0; } } } }
  8. I found a problem with the above approach ( looping thru all nodes and check if a node collided with a mushroom), which is they are seperated, and if they collided, some times, they get glitches, and all the nodes get their own movement, and like all the nodes are distorted and they are randomly moving.     The problem is the other nodes should really follow the head, correct ?    How is it possible to let each node move down one and reverse the velocity ? and all of them should be synchronized ? for each node {for (var b:int = 0; b < m_bricks.length - 1; b++) { if (m_nodes[i].hitTestObject(m_bricks[b])) { trace("hit"); m_nodes[i].vx = 0; m_nodes[i].vy = 5; m_nodes[i].vx = m_nodes[i].previousDirX*-1; m_nodes[i].vy = 0; } } }
  9. it seems I need to read more in probability, can you suggest a book ? for that kind of problems ?
  10. how did you calculate it ? 
  11. Sorry guys about not asking a clear question.    Lets say I have just one column of  3 dices  x1, x2, x3  but I only will generate a random number from 1 >3  for each x  what is the probability that when I do that, I get the same previous generated numbers   for example random numbers from 1 > 3    first toss x1 = 2 x2= 2 x3 = 3   second time  x1 = 2 x2= 3  x3 = 1   what is the probability to get the same first toss results or the same results again ?
  12. Consider that I have two columns  1  6 2  9 5  10   If each elemtn from the first column I generate a random number from 1 - > 3  and for each element for the 2nd column I generate a number from 4 -->6    What is the probability that I get again the same numbers that was generated before  and for how many times ?  
  13. Thanks,  I'm trying to have a better way for controlling the directions of the segments.  so I added those xdir, ydir, initialized to 1,1.  I don't know how to set a flexible directions. if (m_nodes[i].x > 750){ m_nodes[i].ydir = 1; m_nodes[i].xdir = 0; } in game loop   m_nodes[i].x += m_nodes[i].vx*m_nodes[i].xdir; m_nodes[i].y += m_nodes[i].vy*m_nodes[i].ydir;
  14. @paradigm   Can you tell me what do you mean by move down 1 block ? should I make the game as tile maps ? or you mean just move an amount of pixels ?