Jump to content

gamecreator

Members
  • Posts

    4,937
  • Joined

  • Last visited

Everything posted by gamecreator

  1. Thanks for the thanks but I just wrote a quick Leadwerks example using Jon Parise's wrapper. It's his code that does all the work and I'm happy that he made it public.
  2. No, it's C so far. Not sure if it can be converted to LUA. I don't know if LUA and DirectX play together. Edit: I should probably post the code in the description. It's not that long.
  3. You probably saw the one I uploaded as well. It works with any joystick or gamepad but it uses DirectInput so it's Windows only.
  4. Then any idea what's wrong with my code? Shouldn't this make x increase at a constant speed on all computers? x+=0.01*AppSpeed();
  5. There are better ways to do this but you could always move the camera somewhere far and point it at a black box that takes up the whole view.
  6. gamecreator

    S-M-R-T

    Ha, doesn't he wish! He posted in a status update that he is interested in making a game but couldn't get around to it for probably two years.
  7. Thank you all very much, especially Ken for the generous contribution. That gives me a lot to look through and try to implement when I have a little time.
  8. The good thing is that there are second chances. The computer, like the player, is allowed to miss. But if the projectile doesn't hit, it would be because the shot can't be made (because there won't be any wind or overhead obstructions). In that case, the computer will need to switch to a different target. Or a bigger weapon.
  9. Bonus points if you can put the login directly on the "An Error Occurred" page.
  10. Scott, I have collision detection taken care of with EntityCollisionCallback, so I'm set there. Right now my computers are just shooting randomly but I'd love for them to not be so aimless (ha ha).
  11. Thank you Metatron but yes, Pixel is right. I'm looking for code that would calculate the steepest angle that would fire something like this (over hills): float getangle(float x1, float y1, float x2, float y2, float velocity) { float angle; ... ? return angle; }
  12. Hi there. I'm making a simpler version of Worms and I need code (C preferred) to get a projectile from X1, Y1 to X2, Y2 but I'm horrible with math. But it gets a bit more complicated than that. Depending on the situation, there may not be enough velocity to hit the target. So the problem is, given V, is there an angle that exists that will hit the target. If so, what is it (I think there may be two so I would need the steeper of the two). I think this may be the formula I'm looking for (from the wiki): Also, if I understand it right, that assumes X1, Y1 is at 0, 0 so I think that needs to be subtracted from (added to??) the target. Any help would be appreciated.
  13. Very nice. Seems quite user friendly.
  14. Can you define multiple project directories? That would help me because I keep my projects in separate directories and their resources in subfolders. That way I can back up just the projects/resources I've modified.
  15. Ha, no joke. I've kept in mind not to access arrays outside of their bounds, for example, but I never thought of this before. What's funny is that macklebee posted code which made it look like the callback also works with Vec3 but I couldn't get it to work. Not sure if he was just posting that from the top of his head. And there's also Josh's post... Maybe worth a reminder as a feature request but I can live without it too.
  16. I believe I solved my problem. You apparently need to have the entire function declared, even if you're not using the other arguments, so it should have been this: void _stdcall EntityCollisionCallback(TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed) Makes sense since I imagine it still fills the position and other values and since I didn't have those declared, it used the next available memory, which were my variables. At least that's my guess, not knowing much about it.
  17. Hi. I must be doing something very strange. I have the following code: #include "engine.h" TEntity cube, cubephy, ground, groundphy; bool collisiondetected=false; void _stdcall EntityCollisionCallback(TEntity entity0, TEntity entity1) { collisiondetected=true; } int colmode=2; int blah=11; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { Initialize(); RegisterAbstractPath("D:/Programming/Leadwerks Engine SDK"); Graphics(640,480); DebugPhysics(1); TFramework fw = CreateFramework(); SetGlobalObject("fw",fw); BP lua=GetLuaState(); lua_pushobject(lua,fw); lua_setglobal(lua,"fw"); lua_pop(lua,1); TCamera camera=GetLayerCamera(GetFrameworkLayer(0)); PositionEntity(camera,Vec3(0,-2,-5)); RotateEntity(camera,Vec3(15,0,0)); TLight light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); cube=CreateCube(0); cubephy=CreateBodyBox(0.5,0.5,0.5,0); EntityParent(cube,cubephy,0); ScaleEntity(cube,Vec3(0.5,0.5,0.5)); MoveEntity(cubephy,Vec3(0,10,0)); SetBodyMass(cubephy,1); EntityType(cubephy,1,1); ground=CreateCube(0); groundphy=CreateBodyBox(5,0.5,5,0); EntityParent(ground,groundphy,0); ScaleEntity(ground,Vec3(5,0.5,5)); MoveEntity(groundphy,Vec3(0,-5,0)); SetBodyMass(groundphy,0); EntityType(groundphy,1,1); SetEntityCallback(cubephy,(byte*)EntityCollisionCallback,ENTITYCALLBACK_COLLISION); Collisions(1,1,2); while(!KeyHit(KEY_ESCAPE)) { if(KeyDown(KEY_2)) { blah=2; RotateEntity(cubephy,Vec3(0,100)); SetBodyOmega(cubephy,Vec3(0,0,1)); PositionEntity(cubephy,Vec3(0,5,0)); SetBodyVelocity(cubephy,Vec3(0,0,0)); Collisions(1,1,2); colmode=2; collisiondetected=false; } else if(KeyDown(KEY_1)) { RotateEntity(cubephy,Vec3(0,100)); SetBodyOmega(cubephy,Vec3(0,0,1)); PositionEntity(cubephy,Vec3(0,5,0)); SetBodyVelocity(cubephy,Vec3(0,0,0)); Collisions(1,1,1); colmode=1; collisiondetected=false; } colmode=13; UpdateFramework(); RenderFramework(); DrawText(0,40,"Press 1 for Collisions(1), 2 for Collisions(2)"); DrawText(0,80,"Collision mode: %d",colmode); if(collisiondetected) DrawText(0,100,"Collision detected: yes"); else DrawText(0,100,"Collision detected: no"); DrawText(0,120,"Blah: %d",blah); Flip(0); } return 1; } It drops a cube onto a ground or through it, depending on the collision method. What's strange is the variables colmode and blah. colmode stays 13 until the cube hits the ground. It then changes to what seems to be a random number (20776980). Then, when I hit 2, blah changes to that same number as well. But if I run the program and hit 2 before the cube hits, blah changes to 2. Then if I hit it again after the collision is detected, it changes to that odd number. Anyone have any idea what's going on here? I couldn't even guess beyond it having something to do with that callback.
  18. Saw your banner this morning so it must have worked. Good job.
  19. gamecreator

    Darkness Awaits

    I'm with you, GP but Josh is WAAAAY faster than we are. Funny idea Rick. Wish we could help Josh with the game but we can't, for several reasons.
  20. Last we heard from Josh, it's to be out 2012 Quarter 1 at the earliest. Maybe after though.
  21. Thanks! The entire thread doesn't mention smoke in it and it's also in the General Forum, so my fault. But as you said, the search engine can't find combinations of words (unless they're next to each other, like "heat haze" (with the quotes)). It won't, under any circumstance, find that thread using both haze and water in the search (I also tried using + and AND).
  22. That makes me think of what it would look like if the forum would be divided the way the wiki is. It would definitely be easier to link the two, which is a tempting idea. And Roland, what you say makes sense. But then you have topics which either don't apply or apply to more than one topic. I remember somewhere that someone was trying to get smoke (particles) to look correct in front of water (which I think Leadwerks 2 can't do). Which forum would that go in? ...funny thing just now. I was going to try to find that thread to read it and link to it. And I stopped. Where was it? The programming forum or one of the languages? So I'll try all 5... Edit: Lol. Searching for smoke water on all 5 forums results in nothing. Oh well.
  23. Whenever someone asks me which I would like, I often find that I want both. Where filter returns only threads that contain code of the checked language(s). Search would act in a similar fashion (given the lack of subforums to search) but with keywords. Granted, this may not be realistically feasible... but it would be neat.
  24. gamecreator

    Darkness Awaits

    3. But I would like to compare them in higher resolutions. I'd also like to see what other artists can do with it.
×
×
  • Create New...