ID:160492
 
Ok, well I'm making a side scroller for Byond. What I want to do but don't exactly know how to go about it is make a platform invisible but when a player gets close to it, it turns visible. Any ideas?
wait wait im not sure but what you are saying like i dont know what you mean by platform but are you meaning like turf where its like a dungeon look like its black from a disstance and then when you get close it appears is that what you are meaning?
In response to Opop1
If you have ever played something like Megaman it's like where you can't see the block but when you get close to it, it just appears.
You would have to use images for that.
turf/proximity_platform
var
//This is the icon and icon state for the image that
//will be created.
proximity_icon
proximity_icon_state

//The offset of the platform from the turf's layer.
proximity_layer_offset = 0.5

//The distance the player has to be from the
//platform to see it.
proximity_distance = 5

//The image for the platform.
image/image

New()
image = new(proximity_icon, proximity_icon_state)
image.layer = src.layer + proximity_layer_offset
image.loc = src

mob
Move()
if(client)
//If the mob has a client (it's a player), then
//search for platforms.
ProximityCheck()

//Call the parent proc.
..()

proc/ProximityCheck()
//A list of everything in view.
var/list/view = view(src, client.view)

for(var/turf/proximity_platform/p in view)
if(get_dist(src, p) <= p.proximity_distance)
//If the platform is in view, add it to the
//client's images.
client.AddProximityPlatform(p)

else
//If not, remove it.
client.RemoveProximityPlatform(p)

client/proc
//These are in their own procs so that you can modify
//them to perform special actions, if you need to.
AddProximityPlatform(turf/proximity_platform/p)
//Returns true if p wasn't in images. See below.
. = !(p in images)
images += p

RemoveProximityPlatform(turf/proximity_platform/p)
//Returns true is p was in images. See below.
. = (p in images)

images -= p

/*
The assignment of the . value is to check whether the image
was or wasn't already in the list, depending on the proc.
This allows you do do . = ..() and then check the value of
. to determine whether a specific action should be carried
out. You may not want to do something if something was
already removed from the list.
*/
In response to Popisfizzy
Thanks pop now instead of us fighting like cats and dogs we can help him out which u are way more advaqnced then me so i dont have to give him my weak tatics
In response to Opop1
Also known as a Side-Scroller, like Megaman or the Origional Mario games.
In response to ElderKain
ElderKain wrote:
Also known as a Side-Scroller, like Megaman or the Origional Mario games.
Megaman is also known as a platformer, just so you know.
In response to DemonSpree
DemonSpree wrote:
ElderKain wrote:
Also known as a Side-Scroller, like Megaman or the Origional Mario games.
Megaman is also known as a platformer, just so you know.

It's a side-scolling platform then.
Sidescrollers use platforms you jump onto which is pretty much the same thing.
In response to ElderKain
There are megaman games that aren't side-scrollers.
In response to Andre-g1
Andre-g1 wrote:
There are megaman games that aren't side-scrollers.
lol but we are talking about the origional megaman games in general, like the origional SNES ones.
In response to Andre-g1
Andre-g1 wrote:
There are megaman games that aren't side-scrollers.
They're spin-off games of the spin-off's.
I dont count Battle Network/Star Force/whatever to be true Megaman games.
Resident Evil wouldnt be much good in a Hello Kitty world, would it?
Final Fantasy probably wouldn't make a good side-scroller, etc.

And to Kain: ...Megaman started on the NES.
In response to DemonSpree
DemonSpree wrote:
And to Kain: ...Megaman started on the NES.

I never played the regular NES Megaman games, I've only played the SNES ones , so thoes are the only earlier ones I know about.
In response to ElderKain
I see. I tried making a Megaman game on BYOND, but no programmers want to take up the job.
In response to DemonSpree
DemonSpree wrote:
I see. I tried making a Megaman game on BYOND, but no programmers want to take up the job.

Right now what i'm doing is trying to make an exact duplicate of Pokemon Ruby, so My coding style gonna be is quite a bit different than what ur needing, lol. I've tried to make a side-scroller game in the past, but I couldn't get it to work right, like i couldn't get it to where the NPCs woudn't jup off the platforms, and I couldn't get the death pits to work right with the side-scroller coding, lol.