Need Some Help
Blitz3D Forums/Blitz3D Programming/Need Some Help
| ||
Hello all, back from the grave with a question. If any of you have played Vega Strike, you'll know what I'm talking about. What I want to do is turn a spaceship (while in 3D space) according to the direction the mouse is moving. For instance, if I move the mouse to the upper right of the screen the ship should turn up and right. No rolling...just pitch and yaw. The further the mouse from the center of the screen, the faster the turn. I hope that makes sense :). I'm trying to put together something for my son's class and I haven't coded in Blitz3D for a good while! Any assistance is appreciated. |
| ||
Finally sussed it out. Maybe someone has a more clever idea :).;positions x#=MouseX() y#=MouseY() ;half of screen dimensions needed w=GraphicsWidth()/2 h=GraphicsHeight()/2 TurnEntity camera,-(y-h)/w*3,-(x-w)/w*3,0 |
| ||
How would I display text and such on a second camera? |
| ||
Quick shot for you all.![]() |
| ||
About your first question: There are two functions I think can help you: MouseXSpeed and MouseYSpeed. Take a look in B3D help to see how can use them About your second question: Is this a screen shot from your game?. If yes then you already know how to display text. Why you need a second camera? Can you be more specific? |
| ||
Thanks Moraldi, yes that's the game I'm working on. I was thinking of using a second camera as a viewport on the bottom right corner for viewing selected objects. I tried it but ran into some confusion with hiding each camera's skybox from the other. I decided against it since I don't really fancy doing multiple passes. |
| ||
Create a second camera outside of the main skybox and place your selected object front the second camera. I am not sure if this is what you want because my advice its very simple... |
| ||
Anyone fancy tossing me a couple of hints before I dive into the enemy flight AI? I just need to get them moving from waypoint to waypoint for now. That I can handle. It's the appearance of realistically flying (banking, etc) that I'm going to have trouble with. |
| ||
Yet another question. I want more play in the mouse control. I'm looking to have a small rectangular area (circular would be even better) in the center of the screen that is dead space and doesn't have any effect on turning the ship. Once again here's the current code I'm using for mouse steering.;positions x#=MouseX() y#=MouseY() ;half of screen dimensions needed w=GraphicsWidth()/2 h=GraphicsHeight()/2 TurnEntity camera,-(y-h)/w*3,-(x-w)/w*3,0 Any ideas? It's taking longer than I though to brush off the Blitz3D cobwebs.. |
| ||
Something like this ...const DeadSpaceRadius = 50 if sqr( ( x- w )^2 + ( y-h )^2 ) > DeadSpaceRadius TurnEntityEtc... Endif |
| ||
a quick little video of an AI ship stooging around: http://www.headpile.com/stuff/d1.wmv |
| ||
Looks pretty good. Seems to be a bit tough to shoot anything as you demonstrate. |
| ||
Thanks Stevie G, wasn't really aiming at anything. Just firing off a few rounds. |
| ||
Hey! That looks great! Tell us more about your project. What's the story Is gonna be a simple shooting game or a space trading fighting game? Do you have a time plan? |
| ||
Another video (please excuse the shabby cockpit and other programmer art). Made some optimizations, implemented a VERY rudimentary weapon system and a few other odds and ends. http://www.headpile.com/stuff/d2.wmv I'm shooting for a multiplayer deathmatch/teamplay/CTF type setting. I plan to implement items floating in space for pickup such as weapons, ammo, armor, regeneration, speed boost, invisibility, etc. Think Quake. Server browser also but that will take a bit. I've also been kicking around the idea of portals to fly into that will warp the player to a different location. No ship will be faster or more powerful than the other. Players will be able to skin their ships. I suppose I will need to keep the players in a confined zone, probably by creating a pivot in the center and damaging their ship if they roam too far. Of course I need to concentrate on the basics for now, but I figure I still need to lay out a design doc of sorts. |
| ||
Yet another video. Having fun with homing missiles :). http://www.headpile.com/stuff/d3.wmv |
| ||
stayne: I liked the videos and the futures you are thinking about. I hope to finish and give us a good game. |
| ||
Thanks Moraldi. |
| ||
Const DeadSpaceRadius = 50 If Sqr( ( x- w )^2 + ( y-h )^2 ) > DeadSpaceRadius TurnEntityEtc... Endif Sqr() just slows things down (not that it really matters in this usage). This does the exact same thing, just a wee bit faster. const DeadSpaceRadius = 50 If ( x- w )^2 + ( y-h )^2 > DeadSpaceRadius*DeadSpaceRadius TurnEntityEtc... Endif |
| ||
another vid.. working on the CTF stuff. as always, ignore the crappy visuals. the bot picks up both flags near the end, which is not supposed to happen of course. still much to do. http://www.headpile.com/stuff/d4.wmv |
| ||
Over the weekend I made a heroic attempt to stitch Blitzplay Pro 2.2 into my code. Let's just say I made a mess of things. Lesson for the day: If you plan on including network play in your game start the network code EARLY. Also, unless you're 100% certain (mmmhmm) the code you're about to stitch in isn't going to break things, back up ALL of your .bb files. Needless to say I've set myself back a few days. Time to started unweaving my tangled web. |