Sand Game with Drawing

Get help using Construct 2

Post » Wed Apr 17, 2013 2:15 am

Hi everybody!

I started using Construct2 weeks ago and I already love it!

Now I have a new game for a client, similar to this: http://pensar.chulojuegos.com/juegos-de-tacita-de-azucar.html

Basically, its a "sand falling" game. So there is 2 things I want to know how to achieve with Construct2:
- How to draw new "particles". That particles can be a mini-sprite and should have the rigidbody behaviour.
- How to draw the "line colliders" (which will contain the "sand")

I was trying and searching but could not figure how!

Thanks a lot ;)
B
6
S
1
Posts: 5
Reputation: 864

Post » Wed Apr 17, 2013 2:39 am

Hmm... this kind of game is actually pretty hard to make efficiently in C2. I'm sure @R0j0hound or @Yann will have some genius idea but I can't really think of a good way to do it.

Are you aiming for mobile support? If not, you may be able to get away with one of the inefficient methods I'm thinking of.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Apr 17, 2013 2:57 am

Hi @sqiddster! Thanks for your reply!

Yes, the game is actually for mobile, and must be HTML5 based. So I thought it was a good idea to make it with Construct.

I was worried about efficience too. I am new making HTML5 games (but no in game development with lots of another languages) and I was wondering how difficult this can be with C2 and HTML5 in general too!

I still didn't accept the project, so if there still time to avoid it.. good to know it! XD

But if there is a good chance to makes it work with C2 for mobile, then I will aim for it!
B
6
S
1
Posts: 5
Reputation: 864

Post » Wed Apr 17, 2013 11:28 am

The only possible way I think this could work with mobile in C2 is if you get really deep into the 'pure mathematics' and learn about celluar automata. Even so, there's a good chance it wouldn't work. I'd probably suggest using another language for this project.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Apr 17, 2013 2:40 pm

for this kind of calculation you're better off with GPU acceleration
http://www.scirra.com/forum/falling-sand-on-gpu-through-pixel-shader_topic63143.html
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Apr 17, 2013 3:15 pm

I see... thanks for the replies!
@Yann, do you have some open sample project/tutorial of the link you shared? I would love to see how you implemented it! (if not secret =P)
B
6
S
1
Posts: 5
Reputation: 864

Post » Wed Apr 17, 2013 3:17 pm

@Omegalpha
As you can see I'm not the author of this topic, I've never really programmed shaders.
Quazi is way out of my leagues he does some crazy stuff. If I am a good technician, this guy is a bloody magician :D
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Apr 17, 2013 10:18 pm

Quazi's method would work just as fast in C2 except there is no way in C2 to save the result of an effect to use on the next frame.

Other than that the logic to move the pixels is simple.
* if the area is free below a pixel is free move it down.
* if the area is not free try to move down left or down right if those areas are free.

Here is a demonstration using my canvas plugin. As you can see it is very slow. For this sort of thing you'll want a method a lot faster, but for that you'll have to delve into some javascript.
https://dl.dropboxusercontent.com/u/5426011/examples17/sand.capx
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests