Physic Objects + Drag&Drop control

For questions about using Classic.

Post » Thu Dec 31, 2009 12:12 am

[quote="deadeye":9xd0pw4c][quote="eski":9xd0pw4c]I'm running construct v.0.99.72 and all the files run kinda funky.. [/quote:9xd0pw4c]

I can confirm that's true. It's likely due to the new changes to the Physics behavior in 99.72. Since this .cap was made in an earlier version, the changes to Construct broke it. It happens occasionally, when changes get made something might break. That's the nature of beta software... nothing is permanent yet.

Anyway it is fixable, as you said... you can click on each object and apparently that propagates the info in the new "Simulation Steps" field in the properties that was added in the recent build. And any new physics project made with 99.72 will work fine.

By the way, the millions of balls dropping down thing is what is supposed to happen... it's coded with events to do that ;)[/quote:9xd0pw4c]

ahh.. figures.. thought it was something like that..
didnt look at the code that well.. was in a real hurry.. running late to see Avatar in 3d.. awesome.. :D

btw.. did you get the pm ? :oops:
B
7
S
1
G
3
Posts: 66
Reputation: 1,651

Post » Thu Dec 31, 2009 2:23 am

Yeah I did, sorry I've been a bit busy. I'll take a look at it later and let you know what's up.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Dec 31, 2009 2:44 am

[quote="deadeye":3ga27izc]Yeah I did, sorry I've been a bit busy. I'll take a look at it later and let you know what's up.[/quote:3ga27izc]

np :D
B
7
S
1
G
3
Posts: 66
Reputation: 1,651

Post » Sun Jan 03, 2010 6:30 pm

Thanks for your help - again ;D. However, I encountered another two problems where I'm afraid I also might need your valuable assistance ;) :

First, I'd like to implement some kind of ball counter showing the remaining amount of balls left represented by little ball icons. So I figure you'd have to spawn as many ball sprite instances as a ballcounter variable counts - any ideas on what might be the easiest way to achieve that ? (especially the spawning part)

Second, I'd like to define a "game over" state that ends the game. The problem is that having used the (indeed quite valuable) 'forbidden area sprite'-workaround I still don't have any means to make sure that the scene has "settled". This very problem becomes apparent when all my balls are fired away (and eventually destroyed) and the castle is in the process of falling apart but still within the bounding of the forbidden area sprite. Any ideas on that ?

Thanks in advance !!

[url:1rprmqqj]http://www.oinobareion.at/~hullux/undersiege.0.01.cap[/url:1rprmqqj]
B
2
G
3
Posts: 14
Reputation: 878

Post » Sun Jan 03, 2010 7:16 pm

[quote="BarneyGumble44":1d0h83rr]First, I'd like to implement some kind of ball counter showing the remaining amount of balls left represented by little ball icons. So I figure you'd have to spawn as many ball sprite instances as a ballcounter variable counts - any ideas on what might be the easiest way to achieve that ? (especially the spawning part)[/quote:1d0h83rr]

Here's one easy way of doing that:

http://dl.dropbox.com/u/529356/ballcounter.cap

It uses Tiled Background. I resized your ball sprite to fit in a 32x32 space.

As for the game over thing... do you mean you want to know when all of the wall pieces have stopped moving?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jan 03, 2010 7:28 pm

Thanks deadeye, you're fantastic ;D. Small problem, though, the ballcounter.cap doesn't open correctly (on both my machines) (runtime error/abnormal program termination), could the file be corrupt or something ?

As for the game over issue - yes, that's exactly what I meant ;)
B
2
G
3
Posts: 14
Reputation: 878

Post » Sun Jan 03, 2010 7:48 pm

That .cap is using v0.99.72, you should be able to open it with that. Sorry for the confusion.

Anyway, you could try a For Each loop on your wall objects, and add up all their X and Y velocities (make sure to change them to a positive number first, like abs(wall[physics].VelocityX), etc.). Then when the loop is done, if the total of all their velocities is, say, less than 1 or 2 then you know they're pretty much settled. Of course you should only start checking for this after you confirm a hit.

As for setting states for your game, you could try putting your events into groups. All of your control events in one group, all of your collision events in another, etc. Then when you "win" you disable the control and collision groups and activate the "win" group which has all of your winning events in it. Same for "game over." You can disable groups by default in the event sheet editor and activate/deactivate them at runtime using System actions.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jan 05, 2010 2:18 am

Thanks again :D . I tried a ForEach loop that gets invoked every 10 milliseconds (just for testing purposes) and checks if the sum of the absolute .velocityX and .velocityY of each single wall instance is zero (thus indicating the wall elements to be "settled"). However, it seems to pick only one instance, although the documentation of system conditions/loops states that a Compare Values-event , if placed below/in a ForEach loop, picks every single object instance. Am I overlooking something important here ?

[url:15oee3tv]http://www.oinobareion.at/~hullux/undersiege.0.01.cap[/url:15oee3tv]
B
2
G
3
Posts: 14
Reputation: 878

Post » Mon Jan 11, 2010 11:29 am

Another problem I encountered is that when I try to spawn a family (of sprites) on an image point of another sprite, it merely spawns randomly selected (at least it seems to me that way) family members. Please help ;) ...
B
2
G
3
Posts: 14
Reputation: 878

Post » Tue Jan 12, 2010 1:26 am

make sure that the sprite that is spawning is not in the family of the spawned objects
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests