How do I control movement of boats to look realistic

Just started using Construct 2? Post your questions here

Post » Thu Dec 22, 2016 8:09 pm

Message: MLCreative can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi. I have a class of pupils who have been creating a really simple game firing canonballs from a Houseboat at Little Boats. It's all related to a Swallows and Amazons theme to our lessons this year. Anyway, they've drawn/painted the boats in Art class and then we've been building the game during our IT lessons. Pupils are aged 10 years. Problem we've got is controlling the movement of the boats so they are slightly more realistic then at present. We've given them 8-Direction, which is perhaps wrong, and haven't used physics or gravity . All suggestions hugely appreciated - this is the first time I've used Construct2 so it's been a big learning curve for me too!
It's been a lot of fun, but the boats are driving us mad as they sail upside down and back to front! Thanks so much in advance.

Single .capx file shared on Dropbox here https://www.dropbox.com/s/mvpxt1d8ghz72 ... .capx?dl=0
B
3
Posts: 5
Reputation: 185

Post » Thu Dec 22, 2016 9:24 pm

I would go with the bullet behavior.
On click set variable target x, target y to mouse.x, mouse.y
System every tick bullet set angle to anglelerp(self.angle(angle(self.x,self.y,target x,target y),yourturningspeed*dt)
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Fri Dec 23, 2016 8:49 am

Dear Newt - about to go and implement your suggestions, but just wanted to say a huge Thank You - with over 7,000 posts under your belt you clearly know what you're talking about so I'm immensely grateful you've taken the time to respond to my query.
B
3
Posts: 5
Reputation: 185

Post » Fri Dec 23, 2016 5:07 pm

If you need an example capx I can whip one up quick. I've played with that mechanic before.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Fri Dec 23, 2016 5:13 pm

Yes. Please. Thank you. Indebted. Christmas is but around the corner and the boats are still cavorting in all different directions! Plus we have to import music - one of the children has played the Drunken Sailor Sea Shanty on penny whistle and apart from converting it from MP3 to format the Construct2 likes I don't think that's going to be an issue - but in spite of best efforts today I still can't get the Houseboat to neatly fire cannonballs at the LittleBoats.
B
3
Posts: 5
Reputation: 185

Post » Fri Dec 23, 2016 6:21 pm

Line of sight behavior works pretty good for cannons.
https://dl.dropboxusercontent.com/u/666 ... tface.capx
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Fri Dec 23, 2016 6:30 pm

I'm on an Edu deal - but can't open this file as it says it's been built in latest version of Construct2 ! I'm on version 233 you're on version 241. Can it be saved to be compatible with my existing version?

We've got the canon firing (used Imagpoints) - it's the boat's that fling themselves around the screen in a parody of drunken abandonment that are messing with our heads..... We want them to stay upright and just sail left to right and up and down
B
3
Posts: 5
Reputation: 185

Post » Fri Dec 23, 2016 6:49 pm

You could try unzipping the capx by renaming it to boatymcboatface.zip. Then open the New project.caproj into your xml editor.
Replace <saved-with-version>24100</saved-with-version>
With <saved-with-version>23300</saved-with-version>
Save it, and you should be able to double click the caproj for editing.
I don't think there were any changes to those objects between the updates.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Sat Dec 24, 2016 9:57 am

I thought maybe that file would be a good example for a lunar lander type behavior but nope. I really wish I knew what a lerp was :D
Image
B
18
S
9
G
3
Posts: 41
Reputation: 3,198

Post » Sat Dec 24, 2016 3:10 pm

Lerp is linear interpolation of two values based on a percentage using a range of 0 to 1, where 1 would be 100 percent.
Lerp(0,100,0.5) would equal 50
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests