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


  • Content count

  • Joined

  • Last visited

Community Reputation

106 Neutral

About riku743

  • Rank
  1. Aha! I had tried using D3DXMatrixTransformation2D before, but I was using it only for the scaling, not for the position as well. It apparently works better if you do it all at once. Also, now that it's doing it this way, setting the center to the actual center doesn't mess things up.   ....However, although the sprite is now visible, it has somehow done both a horizontal flip and a vertical flip, and has moved up . Or, more accurately, a 180 degree rotation. Here's what the adjusted code snippet looks like: D3DXVECTOR2 vCenter( s_sprite.width/2.0f, s_sprite.height/2.0f ); D3DXVECTOR2 vPosition( s_sprite.xPosit, s_sprite.yPosit ); D3DXVECTOR2 vScale(1.0f, 1.0f); D3DXMATRIX transMatrix; s_sprite.lpSprite->Begin( D3DXSPRITE_ALPHABLEND ); if(s_sprite.flipHoriz) vScale.x = -1.0f; D3DXMatrixTransformation2D(&transMatrix, &vCenter, 0.0f, &vScale, NULL, 0.0f, &vPosition); s_sprite.lpSprite->SetTransform(&transMatrix); s_sprite.lpSprite->Draw( t_texture.lpTexture, &srcRect, NULL, NULL, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f) );   It's possible I'm just using D3DXMatrixTransformation2D incorrectly. Before I changed the center to the real center, it was as if it flipped horizontally, and then reflected vertically over the top line bounding the sprite rectangle. Now it stays in the same place, it's just upside-down.   Edit: Nevermind! I had it making the y value of the scaling vector negative, when it seems it should have been the x value in this case. Thanks for the help, guys.
  2. Out of curiosity, why not?
  3. Nope. The position is as it should be, everything from all measures I can think of appears to be normal. I can even still move it around as usual. It's just not visible. 
  4. I'm not back face culling -- my game is completely 2D, so I assumed I didn't need to. I tried setting the cull mode to none, and it didn't change anything.   If you mean the UVs for the texture, I don't actually set those. I create the texture using D3DXCreateTextureFromFileEx and loadTexture(), and then Sprite->Draw() to associate it with the sprite. I don't ever draw textures directly or onto anything but sprites, so as far as I know it wasn't necessary to do anything else (and it worked fine up until this point). If you mean something else, could you elaborate?   I'm pretty new to this, apologies if I don't understand or am doing things in a non-standard way.
  5. Hi,   I've been working on a 2D game using DirectX, and it has been going pretty smoothly. I have a structure set up to contain data for a sprite, including its position and the actual sprite object (lpSprite) as well as some variables dealing with movement speed and etc. There is a function I've made to draw a given sprite with a given texture, and it works well. Until recently, I had two separate textures for one of the sprites, with each texture facing a different direction, and it would draw the sprite with one of the textures depending on which direction it was facing. This worked fine, but I didn't want to have two textures for each as I started adding more sprites to the game, so I started looking into how to flip a sprite horizontally using SetTransform. Below is a snippet of code taken from my function that draws the sprite. D3DXVECTOR3 vCenter( 0.0f, 0.0f, 0.0f ); D3DXVECTOR3 vPosition( s_sprite.xPosit, s_sprite.yPosit, 0.0f ); s_sprite.lpSprite->Begin( D3DXSPRITE_ALPHABLEND ); if(s_sprite.flipHoriz) { D3DXMATRIX transMatrix; D3DXMatrixScaling(&transMatrix, 1.0f, -1.0f, 1.0f ); s_sprite.lpSprite->SetTransform(&transMatrix); } s_sprite.lpSprite->Draw( t_texture.lpTexture, &srcRect, &vCenter, &vPosition, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f) );   The part that I added recently is the if(s_sprite.flipHoriz), which is a bool, and the three lines inside the if statement. Now, after adjusting the code so that when the sprite should be facing left flipHoriz is true, when I run the program and move the sprite to be facing left, it is no longer visible. Its position remains at what it should be, and the program doesn't stop running, but you can't see it anymore. When I move it back to be facing right, it still is not visible.   What did I do wrong? After looking around on the internet, it seems that my sprite's center being at 0,0 is an oddity and this may be part of the problem, but up until this point, it worked fine. Also, I tried setting the center to the actual center of the sprite, but the same problem persisted (and all of the sprites were drawn in the slightly wrong place).