The Daily Click ::. Forums ::. Klik Coding Help ::. paste into background

Post Reply  Post Oekaki 

Posted By Message



VIP Member
3rd July, 2009 at 07:40:49 -

Well, I know of a possible solution. Something that I plan on trying but have not gotten around to yet.
Basically what you'd need to do is use spread values and use the create at command to create a new instance where you want it to be
"pasted into background" at. While that is happening, you'll need to store the location information of where you created it at, plus set its alt value (so that you can keep it from moving with an event if it's an instance of something coded to move and you don't want it to).

After all that, you'll want to make it so if the instance is a certain distance away from the character and not in the viewable area it gets destroyed. Now here's the thing, you've still got that information stored of where you created the instance. You then take that location info and if the character's location is within a certain distance of that, create the instance (just off screen) ...

... This is only a guess as to how it might work, but I've had hunches that have panned out before .. the only thing one can do is try.
.. quite alot of work though, I know, but if it works and creating/deleting object instances doesn't down the speed, then it will mean infinite active object instances (and infinite active objects period if the ones needed offscreen don't count) ... unless you stack over 20,000 actives all on the currently viewable portion of the playfield of course ..

Click Me!

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?




Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
3rd July, 2009 at 10:52:48 -

the only thing i have to say about that is the amount of polling youd have to do. looping through all instances to check to see if they are close enough or far enough away to create or destroy them would get really laggy.

my current project is becoming less and less what i originally wanted it to be because of the sheer limits of mmf2. everytime i want to pull something off, every method i try either fails or is unbearably slow. which is sad cause the game will turn out nothing like i wanted it to, or ill just end up abandoning it.



5th July, 2009 at 09:58:11 -

Reinterpretation of MBK's idea:

Blood hits the background. Save that positioning data. When the blood is both off-screen and some arbitrarily sufficient distance away from the edge of the visible area, do some "garbage collecting". When garbage collecting, what you would be doing is removing excess blood pastes when the player isn't looking, and replacing them with other objects. You'll want to be doing this for pasted objects that are overlapping each other, where this trick will really save on memory.

A bit o' sleight-of-hand.


Post Reply



Worth A Click