The Daily Click ::. Forums ::. Klik Coding Help ::. Your Thoughts on Destructible Terrain
 

Post Reply  Post Oekaki 
 

Posted By Message

Pan-tosser



Registered
  24/10/2008
Points
  520

Has Donated, Thank You!
29th April, 2016 at 29/04/2016 01:45:21 -

I'm almost sure everyone has seen the surface object example at

http://www.andersriggelsen.dk/mmf2_examples.php

Image

It was my first exposure to the surface object. I like it so when i was bored today. I decided to play around with it.
I switched it's settings to multiple images. And wrote a fastloop to scan the second image for blue. Using the blue as a key to reference exactly where to draw transparent into the terrain.

Once you click it cuts a little dinosaur into the rock.

Image

My problem is I'm getting one little pixel artifact in the tail. Any ideas as to what's going on?




 
https://www.facebook.com/nathon.brown.7

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
29th April, 2016 at 29/04/2016 12:13:18 -

You'd need to give us a lot more to go on...
Having said that, by far the easiest way to achieve the effect you're going for, would be to "blit" a separate dinosaur active onto the surface. Just give the dinosaur and the surface different transparent colors, so that the actual color of the dinosaur is the same as the transparent color of the surface. The catch is that it wouldn't work with alpha channel transparency...

 
n/a

Pan-tosser



Registered
  24/10/2008
Points
  520

Has Donated, Thank You!
29th April, 2016 at 29/04/2016 18:00:24 -

Your right about that sketchy. "blit" is for sure the intended and best to do this.

I'm mainly experimenting and participating with fastloops and the surface object. And pixel by pixel scanning, i feel is a useful skill. Comes in handy if you had more things for the computer to decide. Example sourcing a giving color under a action point, and using that color to decide if damage is allowed. Or special Armour or ability exist.

In my example i used set image. The scanned image isn't seen only because the image is set back before the end of the frame. I know set image is meant to be used to make sprites out of the surface object. But i was seeing if it could be used for other stuff too. I still can't figure out how to use the "set editing image"

But i might play around with it some more. I think it would be useful for their to be another example out their. That people could learn from. That built on top of the original surface object example.

If you'd like to take a look. https://www.dropbox.com/s/unu6rwxqb7c53xm/terrain2.mfa?dl=0



 
https://www.facebook.com/nathon.brown.7
   

Post Reply



 



Advertisement

Worth A Click