ID:149698
 
Okay, I basically want to do two things:

First, I want to check and see if there is a block below the player.

(if W=wall, p= player, I want to check this:)

W p
WWWW WWW
WWWW WWW



I also want to know how to change state of a block (ie: solid to nonsolid) at a specific X and Y coordinate.


My plan is to make a sidescroller, where if there is ever a wall below, to the left, and to the right of the player, then he dies. In other words:

WpW
WWW = death

WpW
W W = the player moves downward until he can no longer move downward



I think my calculator has a better programming language for making things like this, and it uses basic. Too bad it isn't online capable. =D
yes i am sure youre calculator is great but here is one idea use something like this [M.x],[M.y],[M.z] define wall or what ever as M. I dont know how to do that because i aint that godd but that should give you a lead i hope
In response to Mrhat99au
You'd only need two procs and one var to do this. Look up:

Bump()
locate()
density
In response to English
english has it. is this gonna be a game like fall down? because if so you could always put a variation on it where the player cant hit any blocks and just use the bump proc to kill the player every time. just a suggestion.
Kaddar wrote:
I also want to know how to change state of a block (ie: solid to nonsolid) at a specific X and Y coordinate.
var/turf/T = locate(x,y,z)
T.density = 0 or 1

My plan is to make a sidescroller, where if there is ever a wall below, to the left, and to the right of the player, then he dies. In other words:

get_step() is the function you want to use here. Read about it in the help and everything should be crystal clear.


/Andreas
BYOND can do x,y,z checks (if you only have one map/level, z will always be 1) with the locate(x,y,z) proc... but it's got your calculator beat hands down with the get_step() proc. Why bother figuring out what's x+1,y,z of player when you can just ask the computer what's east?

(Another idea: define your own constants, UP DOWN LEFT and RIGHT, then you can write a sidescroller in even more natural language.)
In response to Canar
Actually, in my calculator game, the player could go through walls, because the player was drawn with pxl-change(playerx,playery)

so say the player moves left through a wall, this is simplified to not have variables for the dir

//dirchange
playerx=playerx+1
//display
pxl-change(playerx-1,playery)
pxl-change(playerx,playery)


This would change the one space to the left into an "empty" and the space to the right from a full to an "empty.

Of course, this would have many problems in a mutliplayer game, so what I was going to do is save the data of being in a wall to a variable (inwall=1) and if you move while inwall=1 then it would change where you just were back to a wall.


Death is caused in my calculator game by having a wall below you, to the right of you, and to the left of you, all at the same time. This most often occurs when you fall in a hole.

Maybe the language is more powerful than I thought, and more confusing for someone who often uses basic. It's just that the in-game help, I could only find "bump" for type testing, which would not do, as I don't want too detect collusion, but I want to detect what surrounds the player.


Here is a screenshot of the game for my calculator, note the blue dot was added (it is the spawn point) and the blue line seperates levels:

http://www.drigon.com/~ta/lights.gif

(the goal is to fall in the hole on the bottom right hand corner
Kaddar wrote:
I think my calculator has a better programming language for making things like this, and it uses basic. Too bad it isn't online capable. =D

BASIC is a fine language, but once you get over your language prejudice and truly delve into object oriented languages like BYOND you will realize it doesn't even come close.

The problem is that you are jumping into a project before you understand the structure of the language. Go through a couple tutorials, skim through the FAQ (making note of interesting concepts you find there), and play around with basic beginner worlds for a little while, then tackle your project. You'll be amazed at how easy it is.