Sidescroller

by Forum_account
Sidescroller
This library gives you the basic movement system of a platformer. You can make an action/platform game in minutes!
ID:907456
 
Okay, so, i decided to make a new map after i did my map with the white background and black simple squares.

The problem is that the roof is multiplied several times as you can see top there, and i dont want that.



And please, PLEASE, tell me how much X, Y and Z [also, i dont even know what Z Y and X mean, if X is the longitude, idk... so please tell me] i should put to be able to add more icons in each part of the map (i copy pasted and then the square icon to put the icons as walls etc. only reached half of the map...)

Then i'll copy the floors and put them as wall.dmi to be able to walk on them.

Also, my icon only has south, west, east and north movement (even when i only need east and west, of course) but theres no standing movement (i mean... when your character stands still he has a movement...) or jumping movement or i don't know how to make it.

And,i want to know how to make my character's background transparent be cause as you see in this screenshot, he's walking around with a white square...

And, in the same screenshot, you can see that my character remains at his last frame when u press
->. I want him to turn to his normal standing sprite when the person stops pressing ->, but when you press -> for the first time its already done, he can still move but he will stand at the same frame until i change direction to <-.


Explaining Screenshots

http://i205.photobucket.com/albums/bb218/1Ikaz1/ Backgroundfinisheeeed.png

http://i205.photobucket.com/albums/bb218/1Ikaz1/dwaidaws.png

http://i205.photobucket.com/albums/bb218/1Ikaz1/ cHOPPAAAAAAAAAAAAAAAAAAARH.png

http://i205.photobucket.com/albums/bb218/1Ikaz1/ Lolmychar.png
Also, my icon only has south, west, east and north movement (even when i only need east and west, of course) but theres no standing movement (i mean... when your character stands still he has a movement...) or jumping movement or i don't know how to make it.

It looks to me like south is the default standing frame, so what you want to do is make two icon states, with one as a movement state

The first will just have standing frames based on direction while the other will look pretty much like the one you currently have.

In order to get the current standing frame (south in the icon you posted) you can just flip the image.

And,i want to know how to make my character's background transparent be cause as you see in this screenshot, he's walking around with a white square...

To remove the white background you'll want to select "flood" in the controls for icon editing and fill the white portion with the "null" color. You could also just go to edit>colors and then delete the white for the entire icon, however it seems like the character has some white on the hat, so doing this will make those transparent as well, which you don't want.

And, in the same screenshot, you can see that my character remains at his last frame when u press
->. I want him to turn to his normal standing sprite when the person stops pressing ->, but when you press -> for the first time its already done, he can still move but he will stand at the same frame until i change direction to <-.

you have the icon set to loop 1 time, set it to indefinite and remove that last icon state (by reducing frames by 1) you standing state will come from the process I explained above.

And please, PLEASE, tell me how much X, Y and Z [also, i dont even know what Z Y and X mean, if X is the longitude, idk... so please tell me] i should put to be able to add more icons in each part of the map (i copy pasted and then the square icon to put the icons as walls etc. only reached half of the map...)

It seems like your map size is set too low. on the map window, go to options>set map size, and make it larger in X and Y if needed. Z is essentially different "levels". Think of it like an office building. X is length, Y is width and Z is which floor you're on.
In response to Bravo1
Bravo1 wrote:
Also, my icon only has south, west, east and north movement (even when i only need east and west, of course) but theres no standing movement (i mean... when your character stands still he has a movement...) or jumping movement or i don't know how to make it.

It looks to me like south is the default standing frame, so what you want to do is make two icon states, with one as a movement state

The first will just have standing frames based on direction while the other will look pretty much like the one you currently have.

In order to get the current standing frame (south in the icon you posted) you can just flip the image.

And,i want to know how to make my character's background transparent be cause as you see in this screenshot, he's walking around with a white square...

To remove the white background you'll want to select "flood" in the controls for icon editing and fill the white portion with the "null" color. You could also just go to edit>colors and then delete the white for the entire icon, however it seems like the character has some white on the hat, so doing this will make those transparent as well, which you don't want.

And, in the same screenshot, you can see that my character remains at his last frame when u press
->. I want him to turn to his normal standing sprite when the person stops pressing ->, but when you press -> for the first time its already done, he can still move but he will stand at the same frame until i change direction to <-.

you have the icon set to loop 1 time, set it to indefinite and remove that last icon state (by reducing frames by 1) you standing state will come from the process I explained above.

And please, PLEASE, tell me how much X, Y and Z [also, i dont even know what Z Y and X mean, if X is the longitude, idk... so please tell me] i should put to be able to add more icons in each part of the map (i copy pasted and then the square icon to put the icons as walls etc. only reached half of the map...)

It seems like your map size is set too low. on the map window, go to options>set map size, and make it larger in X and Y if needed. Z is essentially different "levels". Think of it like an office building. X is length, Y is width and Z is which floor you're on.

I don't understand the step to make the standing movement and jumping movement.

I don't know where is the null color.

I couldn't do the 3d step because i couldnt understand the first one.

But still, thank you so much, i made 2 questions already and you where the first one to post and help me ^^ i appreciate it a lot.


I don't understand the step to make the standing movement and jumping movement.

You may just want to look at how set_state() works in sidescroller and then use that to change the animations you use.

for example:
mob
set_state()
if(!on_ground)
icon_state="jumping"
else icon_state="standing"


then you would have in the icon, a state called "jumping" and another called "standing".

I don't know where is the null color.

When in the image editor it's the color on the far left. It should look like a gray color, it's also automatically set as the color for right click, so you don't have to choose it, just right click and it'll use that color.

I couldn't do the 3d step because i couldnt understand the first one.

I cleared it up a bit (I think) so let me know how it goes and we'll talk about this one.
Still... i googled how the set_state works and i didnt find anything. So still...

I removed the white and now it looks awesome.
set_state() is a proc in sidescroller... google wont help you find it.. look inside the sidescroller code.
I only found this.

proc
// Calls left, right, top, or bottom based on src's direction.
front(d, bottom = 1, top = null)

if(dir == NORTH)
return top(d)
else if(dir == SOUTH)
return bottom(d)
else if(dir == EAST)
return right(d, bottom, top)
else if(dir == WEST)
return left(d, bottom, top)
else
this is the front() proc.

You seem to have no clue what you're doing...

use CTRL+H to bring up "advance find and replace".

Enter: "set_state" then make sure to select "all included files"

then search until you find the proc definition.
I think i found what i want.

set_state()
Figures out what icon_state the mob should have and assigns it to the mob.

// Your icon_state depends on your current situation, like this:
// if you're on a ladder you're climbing
// if you're not on the ground (and not on a ladder) you're jumping
// if you're not moving (and are on the ground and not on a ladder) you're standing
// otherwise you're moving (walking)
set_state()
var/base = base_state ? "[base_state]-" : ""

if(on_ladder)
icon_state = base + CLIMBING
else if(!on_ground)
icon_state = base + JUMPING
else if(moved)
icon_state = base + MOVING
else
icon_state = base + STANDING



The problem is that i dont know how to combine it with other codes and words, the indentation, etc. to be able to put jump, fall and standing movements !

Yes, i have no idea what i'm doing but i'm reading a guide at the same time i develop the game and i think i'm doing fine.
if you want, you can use the example I posted above to override it to make your own way for set_state() to choose the icon_state.

In the example though, I used spaces to indent the code so you want to copy it over, remove the spaces and then add indents with "Tab"
You need to fix it's indentation. Refer to his code above and make it look like that.
Now i figured out what was the problem. Now, when he jumps, he changes to his jump icon but the jump is always in the same direction (i mean, if i make him jump back he faces forwards...) aand, i dont know if Standing should be a movement state or sumthin.

I got 3 icon states on my mob: The one with the walking, the one jumping and the one standing.

Couldn't we have a chat to talk better?

I don't know how to make a xat room... i mean a entire site with only the chat, the only options i see is putting a xat on my forums and things like that xD
in the jumping state, set it to 4 directions and fill the directions with his icon, this way, when he jumps to the left it'll display the WEST dir of the icon, so just make sure that the WEST direction of the jumping state is of him jumping to the left.
Done :D it works.

Now uh, with the standing problem (it is not a movement, is always the same sprite), when i press -> or <- the standing sprite remains and it doesnt change to the moving -> <- sprites.

REMEMBER IF YOU NEED SCREENSHOTS TO UNDERSTAND BETTER THE PROBLEMS OF ANYTHING JUST ASK ME.

As i said, i got 3 icon states on my mob: The one with the walking movements, the one jumping and the one standing.

Seriously, think about the chat idea, i know you've got more things to do, a real life and have hobbies etc., but since you've helped me a lot (i advanced so much in this game thanks to you) i think it would be more comfortable talking through a chat to get instant help instead of having to wait 4 hours each post.
in the walking one you have on the bottom right of the window it shows: loop []indefinitely, [x]Once

Change it to indefinitely.
Okay, well, you should copy the walking animation into the SOUTH dir, just so that when you look at it on the outside, you can tell what it is.


Rename "standing" to "walking". and the one that you have blank rename it to "standing"

Then you should change your code to something like..

mob
set_state()
if(vel_y>0) icon_state="jumping" //changed to vel_y because if you're falling you don't want to look like you're jumping up.
else
if(vel_x) icon_state="walking" //if you are moving you'll have vel_x.
else icon_state="standing" //otherwise you're just standing.
(I forgot to copy the thing, but i did it after the screenshot)

I used Run the game (i had my map made and all) but i only saw a black background..

http://i205.photobucket.com/albums/bb218/1Ikaz1/errars.png
Double click the name of the walking state, this should bring up a small window for you to rename it, there should also be a small check box that says movement state. Make sure that checkbox is checked off.
Page: 1 2