I see what you mean by the blob not being a solid color after using the alpha clamp effect. At least with any color but black. I think it has to do with how the effect handles premultiplied alpha perhaps if someone wishes to make a modified effect.
As for the quality of the edge you can use different gradients to change that a bit. I’ve found the soft brush in the C2 image editor makes a nicer gradient than the soft brush in C3’s image editor, but other image editors could create better ones.
Finally got around to finding a decent solution to this.
To do the jump I have it squish horizontally as if it was a muscle. I works pretty well as it jumps only if on the ground.
uc65862bd2af8ddb7a4b7e98c03d.dl.dropboxusercontent.com/cd/0/get/Ch6xo9E3piVSxysWG-mpWaxVaAMXx-3GawqHSip-atoEFEn4qU5D90dgDL9NYi7hqlUTAtyCqxKr9o1frTqpFj4-DWG1nIemPL33bwg1Uek7ESAQqkD_t_9JBv6cTOAfp6cklKNDOLYH-k_6Sf0lgXXT/file
I was going to attempt to make an example but I found a lot of previous tests that may be helpful. There are probably more but my naming convention is inconsistent. Some use physics for the motion, and some do the motion with math in events. I skimmed over them briefly but maybe a third of them have the forces between every pair of objects.
uc9135105f663e5e34b88415de7f.dl.dropboxusercontent.com/cd/0/get/CiGMPIPSgfqbq9uxWkBBSXWqYNYjnsDQm7xKtXFN6xCDu1BqJWTUYyOHUKMYWZtPje50ayzqPTwL3qanXKDnWzRPoHLhps-HDwxMaIVCeaQmY-coOpnM-KQPfE4g216JUws/file
uc43aeccad1842f451cdef3474f9.dl.dropboxusercontent.com/cd/0/get/CiE3DO4UtoI5ovdv3P1_Od3fuMHbV49kfzTPBfCHnOzhCiRRWdTpnb0_oleVYHvrvUlkxZi47uHAKEcHiTESPYf-d_6GJ1fBjQIGSpnjlVFHqP-zC49CTOyv4u4hR2lK8dE/file
ucf5104945a4f630a7d7fa56cacf.dl.dropboxusercontent.com/cd/0/get/CiFyH3HDCPpo0pvFWEHx-1nxc1sbdsaDLzWAYlgtT1MzJUL6keSD4VX3XyihSzh6CXc92mJP7JSGApA5kN_FCBlPjNFqKQv_RkBFZsZ2d6zdhwtoude9thoJbfNvhZgJuUc/file
uc146dff09dffac7a93416fdf8b3.dl.dropboxusercontent.com/cd/0/get/CiFbceG9IZ9gkVs0JhnDNFM-hT6di4jMVoBhmB_28GgiBzTdahGNssL9LIaOHUz64X6ftgfU5y_lIj9wJ_MyfIRIvtAZR3PA2ugeW0Hfb6kGZyThYFf6uwT5rQmB44KTqJw/file
uc01b60589d23908a4d96e248c6e.dl.dropboxusercontent.com/cd/0/get/CiG04ZUPj8eBIunsaehoAUyFk612F23yQDfEO0dXQnX5tSZQpBmGJT2a7F1_kzph5-edIjsQVIiFFeEiUALHQVsx5lg-cUBKpQb9Xree7lxYAprkp3FDHkAU2-rg7fU5QdEsxMxY6W1fHGcTRemyXaHh/file
uc5a13d630553537db16c2143735.dl.dropboxusercontent.com/cd/0/get/CiFcC1S99L82m9Q5c9inbFzoEiEl9IGgUuCEhNe-AXnjv70rV9mK-NhdALxH3H-Nc0BAN9Dqvy1jl8OmLTMyR50VcpNwuLqMTHnaslz0KN5xzLZ72reI934gZm4-Sw3ujUB5Mw-nJyAptcNfOOo8z13a/file
Ah, so you mean just rolling a sprite then?
uc7fb8ff459093b3b20baa9ef0c4.dl.dropboxusercontent.com/cd/0/get/Ch45yFuMq331nI02t5CBOuCgivzKXUR9LD_RaAOCikg43WHi7b0EC1BYULx7gnC6WZry5udao9VSzoQOWP-k33FWgtuPlgF32lngmSjIcCUEhEDQBILhfmnS-a9UONBpU_ckV2Exnw7GJXY78KhLRfGN/file
Even found an old example that does it in a different way.
uc58327da3500a1ca06dcb3fa7c2.dl.dropboxusercontent.com/cd/0/get/Ch74Q1QDs-6GMCWg8EOPWBjRLPgxB1juX_DdFcNQBorHOE7F1G3ID__s2do2C7PbJn-BcRLfpuJIWfvXFuXnwnpU8JUDaWslxhHAghp4limSEAKon1kfEU9q8K2gx4_w7poaNzAypW5Fch8y5QDgvw2X/file
Roughly you’d do this to apply gravity between two objects a and b. You’ll have to tune it though. Adjust the masses of the objects, and the g variable.
Var g=10000 Var ang=0 Var force=0 Every tick — set ang to angle(a.x,a.y,b.x,b.y) — set force to g*a.mass*b.mass/distance(a.x,a.y,b.x,b.y)^2 — a: apply force (force*cos(ang), force*sin(ang)) — b: apply force (-force*cos(ang), -force*sin(ang))
That handles the gravity between a pair of objects. You’d just have to do that between every pair.
If you search my posts I’ve made an example or two in the past if that helps.
Here is a possible way using a distort mesh to make the cube and some math to rotate around a center on an axis.
uc4e68e1b865b6b75c3aed211acd.dl.dropboxusercontent.com/cd/0/get/Ch5hkleDX8dE5LYD2QGaLOrcd4PtZsT8Qjg8UbRJDXsPPOsWWsgnFvKpJ0ajQAOzpOcCOlNA_VpUHJ7gkbva7eH3TNrY_vOw5MigHt3HP3FtbKZHNFHL9kntYCHeuzqyc8zB7fMuSNyPVRzvMaMDS1y0/file
Develop games in your browser. Powerful, performant & highly capable.
winstreak
Nice analysis.
From that idea the distance on the grid with diagonals would be
int(max(abs(treasure.x-tile.x),abs(treasure.y-tile.y))/32)
For each black hole apply a force to the sprites toward blackhole.x,blackhole.y and the amount of force would be
K/distance(sprite.x,sprite.y,blackhole.x,blackhole.y)^2.
K is just some number. If the black hole is too weak just use a bigger number.
You do not have permission to view this post
Nice job on the terrain and changing the angle of the truck.
It's not super easy to tell how high you are other than the fast rising water. That driver has nerves of steel to attempt driving in such a volatile ecosystem.
I wonder if giving some more variance to the grass texture may help with showing the elevation. Anyways, I had some fun seeing how long i could survive.
You may get better performance with a canvas instead of tilemap.
Even with a tilemap with 1x1 tiles its slow even just erasing.
uc783655077d6ffce30c5ecb209e.dl.dropboxusercontent.com/cd/0/get/Ch4wbHzCykRnHrwmj182WPPYILmYr-5BjVVNqloJV3_G2fk6J4uqdmmj9OjhpFY42q6A7dqXhokOHKR5vNnmk-XRbTfBaY3xtuiXYDRE9zbxz82QWmCqEo2GTxOn52Ji_hjevIouBf0mzTdmIFtKnx_t/file
An alternate idea is to grab a screenshot and use some JavaScript to scan the image for set pixels. It works, but it needs to flicker as I need to hide the other layers for a frame.
uc04985c8262e4a22b6f99475637.dl.dropboxusercontent.com/cd/0/get/Ch7O3AlG0DDTp9CIYQRaoyFiYU3ESi8qkliIlc6gi-SgmfVTeCRE_4m8RjjzV-umHDrm2zjFFCmSTFYSKhCokheMEam5NiopVIlvhUcD3YA9R-XcEv3-8sA1qFDCZfPi8cF6bSaXW0DMukA8uZkN8QEj/file
So here's the example using the C3 canvas. It works well for erasing but loops in events are slow, so here it does the scan of the pixels over multiple frames. Seems to work well, but if you resize the game window in any way the canvas will clear. May need some more logic to periodically save the canvas and reload it as needed.
uc6063cbf0ec88bb62d382a1a66c.dl.dropboxusercontent.com/cd/0/get/Ch4eAknlRnjaXMSqtiGlC1_JFbrnAWki9WU9umfB5ZU7ZrIqkns7ez7s7RTZ_XwX0-Mw0WA9A_LGO38PlflbnSQtsfvVQ2kP8kqS7AD0X3gmwqr3uY4oGUiS_JtDjxDPcbdm_0Irc04Rl-xMRMHAK5M0/file
If you have the full version of c3 you could also handle the canvas pixel scanning in javaScript as that would be much faster.
Scroll down on the properties and click "Make 1:1" to correct that.
Typically you shouldn't get values like that. I've gotten decimals like that when I change sizes of scaled objects or something like that. But I don't understand how that occurs for unscaled objects.
Member since 15 Jun, 2009