• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

226 Neutral

About Deft

  • Rank
  1. error LNK2019 with D3dcompiler.h

    [quote name='viper110110' timestamp='1347858569' post='4980783'] Welcome to C++, where the code's made up and the errors don't matter. Turns out my problem was forgetting MyClassName:: in front of the function, which was left out because I copied it out of the tutorial which had all the code in main.cpp. [/quote] If you don't know, what error matters, this is not mean that it's useless. Think you should try to understand how linker is working. If you've got unresolved symbol, then this means that you declared entity (such as method) and didn't implement it. Such error also could appear when you use library API without adding libraries themselves.
  2. Slowing down movement(For Tetris game) - C++/SDL

    I suggest that you can use the same formula: x += xVel * deltaTime. Why not to decrease x axis velocity value? Then you can set up real X position as x_real = (x / 20) * 20. This will gives you always 20x offset. Sorry, if I'm wrong. With regards.
  3. AS3 Collision Resolution

    Collision detection in AS3 is done by call hitTestObject() function. That's all what you need. If you want check collisions for your object continuously - you can test collisions for each frame. To resolve collisions you need to use some simple mathematics with vectors. If you need to lock object movement when it's under wall (or floor, or ceiling), you need to check test collision and if it was found, prevent changing object coordinates. If you need to reflect object movement (as billiard balls, for example), you just need compute movement vector according to simple physics rule. These rules depends on your environment. In simple situation it will be just a ray reflection. Of course, its very primitive methods, if you need more realistic image, you need to know physics laws and formulas. But often for AS3 it's enough.
  4. Threads and c++?

    [quote name='greenzone' timestamp='1347486742' post='4979482'] Both responses where very very helpful. in fact i have experienced this problem with I/O when trying to load geometry. the process of loading geometry hangs up the entire program and the more complex the geometry the longer the wait. So from what i understand threading would allow me to load geometry on the side of my program with out halting the main thread? I am assuming it would still take time but it would not stop one from continuing interaction with the main program being run by the main thread? [/quote] The thing is that with threads you've change processor timing. As known, processor (let's take single core CPU) can work with only one program at current time, CPU registers can be used only by one application. For example, DOS was single-application system, there you can run only one application simultaneously. Windows becomes the multi-task system, where you can launch few applications simultaneously. But processor is still one-application unit. The goal is that operating system distributes CPU time between few applications that you've ran. When you create additional thread at OS view point this is "sub-application" that can be executed separately from main application or another thread. Main problems during multi-threading programming are locks and concurrent data modifications. Lock appears when one thread needs some data, that can be provided only by another thread, but this thread is to busy and can't answer. So, first thread should do nothing or waiting while another thread will not answered. Concurrent data modification is situation when two or more threads tries change or use the same data. To resolve such problems, for example, in Java use synchronized methods and data. C++ has all these problems too. But another sense is that you really can distribute processor time and make your application much faster. You just should find those pieces of code, that can be separated and instantiated as thread.
  5. Problem with Cannot Find Symbol

    [quote]private BufferedImage image = new BufferedImage(WIDTH, HEIGHT,BufferedImage.TYPE_INT_RBG);[/quote] May be you mean TYPE_INT_RGB or TYPE_INT_BGR? BufferedImage does not have TYPE_INT_[b]RBG[/b] member.
  6. 3D Tiles

    Sorry if I'm not right, but how you want to construct diamond with using squares? Square can give you cube or parallelepiped. In any case of building diamond you need additional triangle(s) for figure to be done. I suggest that you need to adopt your system to work with triangles and then build a diamond or any figure that you want. Sorry if I misunderstood your question. With regards.
  7. According to MSDN for DX9 CreatePixelShader: [quote] Return value Type: HRESULT If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: [b]D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY[/b].[/quote] Just make a switch statement for this variants of errors and look at case that will be invoked. After that point you can actually understand what is wrong with your pixel shader.
  8. Hey there)) Just relocate you base code into separated method. Making constructor big not so good. If you need to get re-usable code, wrap it with public method and call it wherever you want. This is true for singletons too.
  9. [quote name='JETerán' timestamp='1346369547' post='4974963'] URGENT: - Finish the inventory / store system so I can implement the inventory array in the GUI (Please help of EDIT 1 above) - Make the others hitTests for the rest of the in-game objects. Easy. - Make the hero look left when user hits left key. Tricky, I was some time doing this and couldn't figure out, tomorrow I will give it another try (later, actually) - Make the hero's animation (I have the animation in the MC, I just need to play() it the hero moves) URGENT: -Finish the game design, if player ends game, how to call again to call the MissionSelection function (I will work on what you told me Deft about it) [/quote] I don't know, was your problem with array push released or not, but anyway: I'd said a few posts later about that thing that Flash engine transfer variables (non-scalar types, such as custom objects) as links, and not as values. This is means that when you call addChild and use image1, you put some object on the scene. When you trying to add second object on the scene by using same image1 sprite, actually you just adding the same object that already on the game stage. [b]The goal is create second instance of your sprite and that's all.[/b] Turn left/right can be done by reversing source hero image by x axis [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] In ActionScript it can be done by replacing hero image each time key pressed. Yeap, playing hero animation is very simple.
  10. Smoking DirectX
  11. [quote name='JETerán' timestamp='1346367460' post='4974951'] Following your suggestion, what I'm going to do now is create a StoreCreation.as file that extends GameObjects instead of Sprite (right??) [/quote] If your GameObjects class extends from Sprite - yes, StoreCreation will automatically be extended hierarchically from Sprite. But do not miss that thing that you should clean up your game object storage when objects does not needed anymore - that's performance important tip. I think you on the right way
  12. Always welcome [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] What type of event listener you've added? You said, that you add 3 event listeners. I think, you should do that separately. Player in first room. Add event listener, that will test collisions for first room objects. Player hits door to second room. Remove event listener for first room collision testing. Remove first room display objects from the scene. Add all objects for second room to the scene. Add event listener for second room collision testing. When I say "Add event listener", I don't mean, that you should have three methods for each room. You may use only one method and store current room index, where player is at the moment. So, I can rewrite algo: Player in first room. [b]Set _currentRoom variable to 1[/b] Add event listener, that will test collisions for first room objects. [b]Right here I'm using _collisionObjectsContainer[_currentRoom] and that's it - I've got list of first room collision objects[/b]. Player hits door to second room. [b]Set _currentRoom variable to 2[/b] Remove event listener for first room collision testing. Remove first room display objects from the scene. Add all objects for second room to the scene. Add event listener for second room collision testing. After such reimplementation you can adopt this algorithm as base for all of your game stages.
  13. I think, you should remember in what room your player right now. After that you can use three containers: each container for 1 room. These containers should contain list of objects for collision testing from each room. And I think that's will be goal: after that you can successfully remove collision objects from first room, when your player inside second or third room.
  14. [quote name='JETerán' timestamp='1346340729' post='4974830'] As always, thanks Deft for your reply [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] Ok I saved that tip, I will always delete event listeners after use, thanks !! About this code, what I have is just an event listener that's a ENTER_FRAME, if I wanted to remove it, will be a mess. So, to make it more clearly, I think will be better to have many event listeners, one for each collision with the left and right invisible walls; am I right?? How can I add an event listener that knows f.i. leftLimits is touched by hero?? Thanks SO much once again !! [/quote] I've not recommend to add one event listener per each collision object, especially, if you call them for each call - it is overhead in performance, and be sure - it will be performance issue. The problem is that you want to test object collisions after you removed this object from stage. You cannot test collisions if some object is out of stage. If you had caught collision and do stage clean up, you may assume that collision tests should be stopped before doing this work. And moreover you need to clean up all events and objects, because in other cases you will get performance problems after loading few levels. I hope, I understood what do you want )
  15. Using input layout in DirectX

    Thank you a lot. Now I understand what to do [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  • Advertisement