Forum

How to control speed and direction of a moving object?

02 February 2016 03:03 #7025

I think it is a wonderful starter project idea. There is no serious flight simulators of any kind yet on b4w. So it will be really interesting for us to keep track of your app and help to solve problems which you will face
Thank you so much for the support!
02 February 2016 11:08 #7034

Regarding my larger objectives with this, I want to accomplish a few different things in a flight simulator game:

1) Planes should fly (Sounds simple, but I think it will be quite tricky. Evgeny has offered me some advice, but I'm still too much of a newbie to implement it.)
2) The planes should be able to shoot missiles and fire machine guns. Experimenting with methods for doing this was the purpose of this thread.
3) Missiles and other weapons should cause damage. I haven't reached this point yet.
I have an advice for you!
You can start from simpler app that can be made using logic editor without going crazy. Runner arcade mechanics comes to my mind. You can for example divide screen in six areas and move your plane/spaceship between them, fire missiles by clicking viewport aligned buttons (see b4w 15.12 features). There is excellent example of similar mechanics in our new year contest entries:
https://www.blend4web.com/en/forums/topic/1275/?page=1#post-6423
You will be able to focus on things like missiles animation, their interaction with targets and overall game look. And the final app will be solid and attractive itself.

After that you can begin to add freedom to your game using already made templates. We can provide support in adding JavaScript coding. Our engine apps structure is rather straightforward and clear, so even people who not familiar with programming can learn it quickly, especially if you understand logic trees tricks. Of course if you are interested in it!

Again it is just my vision of convenient and enjoyable way of developing your idea
Blend4Web Team - developer
02 February 2016 15:54 #7049
You might want to look at my script is this file. It's really BGE i'm planning to make it in Blend4Web but you got like the basic algorithm.
I'm quite sure most of this can be done with logic nodes.
The car flicks a bit. It seem to be due to the table material. Just delete it if need be.
03 February 2016 17:06 #7089
@Konstantin Khomyakov Thank you for suggesting this idea! Let me see if I understand correctly…
You can for example divide screen in six areas and move your plane/spaceship between them
Do you mean that the plane could be moved to each of the six corners of an invisible cube (in front of the camera)?

I will surely need Viewport Alignment for this and other projects too, so thanks for telling me what that feature is called and where to find an example.

I'm still exploring the possibilities. One thing is for sure - there's no getting around the fact that I need to learn to set up first-person controls sooner or later. I feel that I really should face this, and overcome my aversion to coding.
In any case am curious to learn more about the solution you have suggested.

Another idea I had, since there are no aircraft presets yet, is that maybe I can sort of hack a watercraft setup into working without visible water under it - maybe parenting a block of some kind of "fake" water to it to get it moving through the air. But I haven't even made a conventional watercraft yet, so I am getting ahead of myself.

@LukeVideo
Thanks for offering your .blend to study. I have never used the BGE before, so I'm not even sure where to start. I pressed 'P' and got the car to move using the arrow keys. I couldn't figure out why it disappears sometimes, or why everything is scaled up so large (scaling it down made the car disappear even more easily). Studying the BGE in order to learn B4W seems like the long way to do it, so for now I think I'll just focus on B4W. I appreciate the gesture though.
03 February 2016 18:53 #7093

Do you mean that the plane could be moved to each of the six corners of an invisible cube (in front of the camera)?
You can for example use set of viewport aligned empties and Move To to relocate your aircraft
Blend4Web Team - developer
03 February 2016 23:57 #7102
Yeah. If you had known a bit of BGE it could of made sense. I am not quite sure what you are planning to do but you will need some JS if you really want damage and things like that in your scene. The main issue with the node editor in mys opinion is that is cant sens collision or read external variables. The good thing is that it is quit easy to get things done in JS. I am planning on porting a few BGE experiments i did in Blend4Web so i hope this will give me enough skills to be of help!

Luke
 
Please register or log in to leave a reply.