Tilemap (Creator-Defined Displayable)

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Tilemap (Creator-Defined Displayable)

#16 Post by M-77 »

Hello "zankizuna", thank you for the file and code. I extracted some code part from your "Softwar" demo. I locked the random battle part (I just
want to run around+interact with objects, for some difference in my VN.). But could not remove it from the code for my test project before,
getting some "Not defined" thisand ths error. I made ovn map+tiles+character. I need to try out more with this. So I have some questions:
Can I made the map biger then 17x10 tiles?
Can tiles be 16x16 or 32x32 not 50x50? Could this made the game less laggy?
(I also used "FileOptimizer" to reduce picture size, this might improve performance)
What parts are need to change for higher screen size? I tried to change screen size too from 1020x720 to 1920x1080 but it did not work then.
How many different tiles can I add?
Are there more tiles like the "n"? (This "n" is a renpy code for fill a tile grey?)
If you can, tell us some hints or show code parts here please.

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Tilemap (Creator-Defined Displayable)

#17 Post by M-77 »

I managed to get more tiles in. I found out how to define tiles+objects (I think). I found out how to made them block your way or made them
walkoverable. I found out how to made a bigger map. I made animated water tiles. I can connect multiple maps. I bleed some 8 hours today on
this. More try out is need on this, like full screen 1920x1080 map. Maybe 27x25 tiles big, but not sure. I have simple to try out.

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Tilemap (Creator-Defined Displayable)

#18 Post by bonnie_641 »

zankizuna wrote: Mon Jun 17, 2019 10:32 am Maybe try this?
[archive: Movement]
Thank you very much for sharing your knowledge.
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Tilemap (Creator-Defined Displayable)

#19 Post by bonnie_641 »

nyaatrap wrote: Thu Nov 12, 2015 12:11 pm More advanced demo that allows scrolling a huge map.
Clipboard 1.jpg
tilemap-1.0-all.zip
It's only recently that I've come to read this subject.
Thank you very much for sharing with us.
I don't know if it's too much to ask for a small example to integrate the player in the scenario (recognize collision and the event "if the player is in the coordinate (x,y), jump to label").

Excuse me for my English level.
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Tilemap (Creator-Defined Displayable)

#20 Post by M-77 »

Hello "bonnie_641", this are two different Projects showed here. I can tell a little about the 2nd one by "zankizuna". See the video of his "Softwar" game: https://www.youtube.com/watch?v=IK-aNQs ... e=youtu.be Get the demo here for free, or donate a bit if you like it: https://zankizuna.itch.io/softwar
You can define your tiles in the file "movement.rpy" and on the start inside this file you can define if your tiles are -walkoverable- otherwise they will block you. Just see the tile list:
elif j =='3':
image "images/rpg/overworld/object3.png"
in this file and then you find the strings to customize them.

Upisempty = (boxsheet[playerypos-1][playerxpos]=='0') or (boxsheet[playerypos-1][playerxpos]=='d') or

...and so on, add your stuff here. There are 4 lines for the 4 walk directions. So you have to do it with each.
If pressing 'Z' in game while standing in fron of a tile, for a label jump or some action, you have to define it in the "movement" file here:
label whatactor:
if actornum == '2':
n"That's is water, and you do not like to swim!"
return

In this part you define what a point like "b" (this is a -door- or just a point to jump to next stage, and back.):

if HereisDoor:
if boxsheet == stage0:
call maptransfer([13,5],stage1)
elif boxsheet == stagehome:
$ destination = stage1
if Here=='b':
r "That should be the right entrance."
$ spritelist = []
$ gridpos[0] = gridpos[1] + 1
stop music fadeout 1
call maptransfer([13,5],destination)

(And in the "stages.rpy" you set up the maps in a grid, and this "b"(or other letters, numbers) has to be also there).
Double symbols like "b2", or "c1" etc. are also possible. Map grid can be 25x15 for example. Or bigger.
If you not need random battle, in the "label returns" turn it of with a" '#" here:

$ objxanchor = objxanchor+blockSize
$ playerpos = [playerxpos+1,playerypos]
pause 0.02
$ anim_done = True
#call wildenemy

In "Movement2.rpy" you can define changing the two numbers an item that shows up an the map here:

Heartsprite = SpriteinMap("Heart",[2,1],'down',"Heart")

The floating of your MC and the Items can bee too disabled in the "Movement" file, I forgot where because I removed that part, it was some 3-4 lines about
"linear - 1 linear 1" likie this.
You also need the directories with the sprites from the demo, try out, it can take you 3-4 days. Just watch the video, see how it is working there. See the "images" files. Look where they are in the code to know what they are for. try to change one. See what happen. Try another part. Not change multiple stuff at once. You will get behind the mechanics. Piece by piece. I still not know every part. Just started. And I still not tried to implement this with the first project showed in this thread. Good luck!

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Tilemap (Creator-Defined Displayable)

#21 Post by bonnie_641 »

M-77 wrote: Sat Jul 20, 2019 2:33 pm
You also need the directories with the sprites from the demo, try out, it can take you 3-4 days. Just watch the video, see how it is working there. See the "images" files. Look where they are in the code to know what they are for. try to change one. See what happen. Try another part. Not change multiple stuff at once. You will get behind the mechanics. Piece by piece. I still not know every part. Just started. And I still not tried to implement this with the first project showed in this thread. Good luck!
Thank you very much M-77. :D :D :D
I will study the code and hope to understand it. (Thanks to your help I can start programming the scenario).

But I have a doubt:
I've been experimenting with adding barriers by coordinates (and in a certain way it works).

Code: Select all

default manx = 100
default many = 100

define alto=600 #Screen (height)
define ancho=1200 #Screen (width)

image mono= "images/sprite/1_1.png" #Player image

label start:
    call screen moving1()

    $ r = _return
    $ manx = r[0]
    $ many = r[1]
    
 
screen moving1():
    add "fondo.jpg" #Background
    add "mono" pos (manx, many)
    text "[manx], [many]" #Debug coordinate position 

    key "K_LEFT" action SetVariable("manx", manx-10)
    key "repeat_K_LEFT" action SetVariable("manx", manx-10)
    key "K_RIGHT" action SetVariable("manx", manx+10)
    key "repeat_K_RIGHT" action SetVariable("manx", manx+10)
    key "K_UP" action SetVariable("many", many-10)
    key "repeat_K_UP" action SetVariable("many", many-10)
    key "K_DOWN" action SetVariable("many", many+10)
    key "repeat_K_DOWN" action SetVariable("many", many+10)

    #-------------------------
    # Delimit the wall all over the screen
    #------------------------------
    if 0 < manx < ancho: # X axis
         key "K_LEFT" action SetVariable("manx", manx-10)
         key "repeat_K_LEFT" action SetVariable("manx", manx-10)
         key "K_RIGHT" action SetVariable("manx", manx+10)
         key "repeat_K_RIGHT" action SetVariable("manx", manx+10)
     else:
         if manx < 0: #left limit
             key "K_LEFT" action NullAction()
             key "repeat_K_LEFT" action NullAction()
             
         if manx >= ancho: #right limit
             key "K_RIGHT" action NullAction()
             key "repeat_K_RIGHT" action NullAction()
    #--------------------------------------------------
     if 0 < many < alto: #Y axis
          key "K_UP" action SetVariable("many", many-10)
          key "repeat_K_UP" action SetVariable("many", many-10)
          key "K_DOWN" action SetVariable("many", many+10)
          key "repeat_K_DOWN" action SetVariable("many", many+10)
     else:
         if many <= 0: #top wall
             key "K_UP" action NullAction()
             key "repeat_K_UP" action NullAction()

         if many >= alto: #down wall
             key "K_DOWN" action NullAction()
             key "repeat_K_DOWN" action NullAction()
    #-------------------------------------------------------

# EVENT
# CHECK IF COORDINATE DETECTION WORKS
    if (manx, many) == (150, 150):
        text "Coordinates (150, 150)!!" pos (200,200)


The problem is how to add walls by coordinates. I tried for several days, until I read the topic of nyaatrap. But, it is not compatible with the programming that I have.
What would be the algorithm to put walls?
Example: In this block it puts a limit on the x axis (from 0 to the width). If the player puts his character to the left of the screen, he can not go beyond 0. And if he goes to the right, he can not go beyond the width.

Code: Select all

if 0 <manx <width: # X axis
         key "K_LEFT" action SetVariable ("manx", manx-10)
         key "repeat_K_LEFT" action SetVariable ("manx", manx-10)
         key "K_RIGHT" action SetVariable ("manx", manx + 10)
         key "repeat_K_RIGHT" action SetVariable ("manx", manx + 10)
     else:
         if manx <0: #left limit
             key "K_LEFT" action NullAction ()
             key "repeat_K_LEFT" action NullAction ()
             
         if manx> = width: #right limit
             key "K_RIGHT" action NullAction ()
             key "repeat_K_RIGHT" action NullAction ()

You can put small walls (x, y), but this is just a "point" on the screen.
The ideal would be to put rectangles, but I don't know how to do it; collision detection is very complex :C :oops:
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Tilemap (Creator-Defined Displayable)

#22 Post by M-77 »

Hello, good that you could go on. I am no professional in Renpy. But the Movement.rpy has this way to create wall or 50x50 blocking Tiles (this are from my version I work on):
vbox:
at mover(objxanchor,objyanchor)
for i in boxsheet:
hbox:
xalign 0.5 yalign 1.0
for j in i:
if j =='1':
image "images/rpg/overworld/object.png"
elif j =='2':
image "water"
elif j =='3':
image "images/rpg/overworld/object3.png"
elif j =='4':
image "images/rpg/overworld/object4.png"
elif j =='5':
image "images/rpg/overworld/object5.png"
elif j =='a':
image "images/rpg/overworld/objectd.png"
elif j =='b':
image "images/rpg/overworld/objectd.png"
elif j =='c':
image "images/rpg/overworld/objectd.png"
elif j =='d':
image "images/rpg/overworld/objectd.png"
elif j =='g':
image "images/rpg/tile/Tilegras01.png"

All this will block your movement on a map. To made them walkover able, you have to define them at his point:
label checkwalls: #M-77 define here what tiles are walkoverable and what are interactabe rest images will stay blockable if not defined here and with vbox
python:
playerxpos = playerpos[0]
playerypos = playerpos[1]
Hereisempty = ((boxsheet[playerypos][playerxpos]=='0')or(boxsheet[playerypos][playerxpos]=='s')) #M-77 I ad () and or here for s to be empty, not need?
Here = boxsheet[playerypos][playerxpos]
HereisDoor = ((Here=='a')or(Here=='b'))or((Here=='c')or(Here=='d'))

Upisempty = (boxsheet[playerypos-1][playerxpos]=='0') or (boxsheet[playerypos-1][playerxpos]=='d') or (boxsheet[playerypos-1][playerxpos]=='c') or (boxsheet[playerypos-1][playerxpos]=='b') or (boxsheet[playerypos-1][playerxpos]=='a') or (boxsheet[playerypos-1][playerxpos]=='g') or (boxsheet[playerypos-1][playerxpos]=='m') or (boxsheet[playerypos-1][playerxpos]=='r') or (boxsheet[playerypos-1][playerxpos]=='s') or (boxsheet[playerypos-1][playerxpos]=='t')
Downisempty = (boxsheet[playerypos+1][playerxpos]=='0') or (boxsheet[playerypos+1][playerxpos]=='d') or (boxsheet[playerypos+1][playerxpos]=='c') or (boxsheet[playerypos+1][playerxpos]=='b') or (boxsheet[playerypos+1][playerxpos]=='a') or (boxsheet[playerypos+1][playerxpos]=='g') or (boxsheet[playerypos+1][playerxpos]=='m') or (boxsheet[playerypos+1][playerxpos]=='r') or (boxsheet[playerypos+1][playerxpos]=='s') or (boxsheet[playerypos+1][playerxpos]=='t')
Leftisempty = (boxsheet[playerypos][playerxpos-1]=='0') or (boxsheet[playerypos][playerxpos-1]=='d') or (boxsheet[playerypos][playerxpos-1]=='c') or (boxsheet[playerypos][playerxpos-1]=='b') or (boxsheet[playerypos][playerxpos-1]=='a') or (boxsheet[playerypos][playerxpos-1]=='g') or (boxsheet[playerypos][playerxpos-1]=='m') or (boxsheet[playerypos][playerxpos-1]=='r') or (boxsheet[playerypos][playerxpos-1]=='s') or (boxsheet[playerypos][playerxpos-1]=='t')
Rightisempty = (boxsheet[playerypos][playerxpos+1]=='0') or (boxsheet[playerypos][playerxpos+1]=='d') or (boxsheet[playerypos][playerxpos+1]=='c') or (boxsheet[playerypos][playerxpos+1]=='b') or (boxsheet[playerypos][playerxpos+1]=='a') or (boxsheet[playerypos][playerxpos+1]=='g') or (boxsheet[playerypos][playerxpos+1]=='m') or (boxsheet[playerypos][playerxpos+1]=='r') or (boxsheet[playerypos][playerxpos+1]=='s') or (boxsheet[playerypos][playerxpos+1]=='t')

The '2' tile is a water tile I made (that is animated) it is blocking your way and is interactable if pressing 'Z'. This is to be defined at the start of 'Movement.rpy':
label whatactor:
if actornum == '2':
n"That's is water, and you do not like to swim!"
return
I defined it just above the "screen mapB:" line:image water:
"images/rpg/overworld/water1.png"
pause 0.5
"images/rpg/overworld/water2.png"
pause 0.5
"images/rpg/overworld/water3.png"
pause 0.5
repeat

screen mapB:

You see it is all connected, a little messy, together. I can not tell what you exactly need to do, because I did not code this.
But check the code above+under the ""label checkwalls: maybe this is what you search for. Keep us informed here what else you could find out.

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Tilemap (Creator-Defined Displayable)

#23 Post by gas »

bonnie_641 wrote: Sat Jul 20, 2019 8:34 pm The problem is how to add walls by coordinates.
The problem is : that code from M-77 is almost primitive and "hard coded".
You should use:
A Creator Defined Displayable that get pygame key events
An event check that determine what frame to show each "moment" based on conditionals
> If the game work on tiles (and apparently should) you can move just the quantity of each tile size. So you should determine an x,y coordinate of the player on a virtual grid (in a word, you don't actually check if something touch something onscreen, but by math logic)
Create a virtual grid by a list, that use some code to determine if you can enter or not the target square
Obviously, a way to determine if the map scroll or the character move (that's the daunting task!).

All codes about such projects are very similar, so if you want to indepth you should download the AYDA Overworld Engine here in the cookbook and give a look. Isn't free to use, but you can inspect it at will and get some idea about the task.
There are also some jrpg python projects around github that should help you understand the math logic.

If it sound complex to you, RENPY IS FOR VISUAL NOVELS, if you want to make a nice platformer/jrpg, there are better and easier engines for that. The time to learn how to manage such tasks in renpy can be better spent on GameMaker actually doing such game.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Tilemap (Creator-Defined Displayable)

#24 Post by bonnie_641 »

gas wrote: Sun Jul 21, 2019 3:45 pm
bonnie_641 wrote: Sat Jul 20, 2019 8:34 pm The problem is how to add walls by coordinates.
The problem is : that code from M-77 is almost primitive and "hard coded".
If you only knew how strange the code I wrote is... I'm sure you'd freak out :oops:

For my first game, that's fine. I'm in the learning process (and M-77 as well), so it's worth the effort it makes to help program.
At some point I'm going to look for a tutorial to learn Python.

I really appreciate the help.
gas wrote: Sun Jul 21, 2019 3:45 pm if you want to make a nice platformer/jrpg, there are better and easier engines for that. The time to learn how to manage such tasks in renpy can be better spent on GameMaker actually doing such game.
I tried to use Gamemaker, but it was a waste of time. I spent 4 months learning and it was very frustrating.
Another downside: it's not free.
I know there are several programs: Construct3, Unity, Löve, etc, but I want to learn to use Ren´Py because most of the content of the game is a visual novel.

Although the programming in Python is very difficult for a novice like me, my emotion is maximum because most of the objectives I set I already met and this is the last part.
In case I can't set the collisions (there aren't many) I'll try another method (click and point, drag and drop, etc).
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Tilemap (Creator-Defined Displayable)

#25 Post by bonnie_641 »

M-77 wrote: Sun Jul 21, 2019 10:58 am this are from my version I work on
(...)
You see it is all connected, a little messy, together. I can not tell what you exactly need to do, because I did not code this.
But check the code above+under the ""label checkwalls: maybe this is what you search for. Keep us informed here what else you could find out.
I'll follow your code and try to enforce it.
Thank you very much :D
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

User avatar
zankizuna
Veteran
Posts: 416
Joined: Fri May 04, 2012 2:20 am
Completed: Monochrome Valentine
Projects: Softwar
Deviantart: raseru09
itch: ZanKizuna
Location: Manilaaaaaaaa
Contact:

Re: Tilemap (Creator-Defined Displayable)

#26 Post by zankizuna »

Woah! I'm so glad you guys are studying it >. <

It is indeed primitive, hard coded, doesn't use py itself but instead screens and renpy lang. Variables.

But it works! Tell me if yours do too!


well if you need a working demo of mine you can go ahead and download your copy, the password is ILY.EXE
http://zankizuna.itch.io/softwar-with-files
Super unupdated demo, but I hope it helps!
The map only has 2 rooms, and stuff.

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Tilemap (Creator-Defined Displayable)

#27 Post by M-77 »

Nice to see some response here from other people!
I found the part that is responsible for the floating of an item+player images too:

transform floatmov:
linear 0.5 yoffset -2 #M-77 this for float up-down on maps
linear 0.5 yoffset 2
repeat

Disable this putting the # symbol before each line. If not wished.
It should be possible too to only disable this for the player but leave the floating effect for some items when it makes sense.
Sure easy, define some 'image:' with the above code. but I have no time to try out now.
Another interessting thing would be to let a 2nd game character sprite follow the main character on map. If found in a labirinth for example.
How to achive this? Use a True/false variable. Let display another MC sprites that have the 2nd beside him? But it would go of border when do a 90° turn on map, like showed inside a wall? Not that important now. Zankizuna code is very good. Especialy for beginners, you can see how renpy is working. And do your changes, not getting lost in strange formulas.
EDIT: Just found out. If you get teleported on a blocking tile (you get trapped) and a walkover-able is next you can walk out in that direction.

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Tilemap (Creator-Defined Displayable)

#28 Post by bonnie_641 »

zankizuna wrote: Mon Jul 22, 2019 12:58 am The map only has 2 rooms, and stuff.
Thank you very much zankizuna.
The code you gave us is very useful... It has what I need: create scenarios, has collisions and has events (that in your game appears the fight against viruses).
My idea is to take advantage of those events to include more material (in my case I will include mini-games :P )
M-77 wrote: Mon Jul 22, 2019 10:23 am Another interessting thing would be to let a 2nd game character sprite follow the main character on map.
I imagine that several images have to be edited to give the appearance of the protagonist being followed by several characters.
Example: The player reaches a certain coordinate and we do a verification:

Code: Select all

default manx = 100
default many = 100

define alto=600 #Screen (height)
define ancho=1200 #Screen (width)

image mono= "images/sprite/1_1.png" #Player image
image ily = "images/sprite/ily.png"

label start:
    call screen moving1()

    $ r = _return
    $ manx = r[0]
    $ many = r[1]
    
 
screen moving1():
    add "fondo.jpg" #Background
    add "mono" pos (manx, many)
    text "[manx], [many]" #Debug coordinate position 

    key "K_LEFT" action SetVariable("manx", manx-10)
    key "repeat_K_LEFT" action SetVariable("manx", manx-10)
    key "K_RIGHT" action SetVariable("manx", manx+10)
    key "repeat_K_RIGHT" action SetVariable("manx", manx+10)
    key "K_UP" action SetVariable("many", many-10)
    key "repeat_K_UP" action SetVariable("many", many-10)
    key "K_DOWN" action SetVariable("many", many+10)
    key "repeat_K_DOWN" action SetVariable("many", many+10)


    #...

# EVENT
# CHECK IF COORDINATE DETECTION WORKS
    if (manx, many) == (150, 150):
        text "Ily joined the adventure." pos (200,200)
        add ily pos(manx+10, many)  #It is necessary to calculate at what distance of the protagonist will be.
If you put an image for the protagonist, so that another character follows you, you attach another image:
w0.png
w0.png (2.35 KiB) Viewed 2163 times
<--- leave the corresponding space
w1.png
w1.png (3.05 KiB) Viewed 2163 times
<--- second character here
w.png
w.png (8.23 KiB) Viewed 2163 times
<--- that's what it would look like

I'm going to find a way to add via code, but I think this way is easier.

Thank you so much for everything.
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Tilemap (Creator-Defined Displayable)

#29 Post by M-77 »

Hello bonnie_641, can you tell us some more how to implement your above code?
Just copy+paste it to the "Softwar" rpg code? And to where to exactly?
And for the sidekick sprite, I need to made my sprites of character 1 bigger. With transparent bg to the coresponding direction (where the other, 2nd character, will follow)? Then do a similar with the other sprite 2, but the tr/bg reaching into the direction where the 1st sprite will head on?
Your code then overlap both, and made the 2nd follow the movement done by 1st. And the distance is to define then too? Or not if the sprites have same size?
I would like to turn on/off with a True/False variable if MC1 find MC2.
Can you list some more info how to do this please?
Thank you too and thanks for zanikzuna for the rpg style code!

User avatar
zankizuna
Veteran
Posts: 416
Joined: Fri May 04, 2012 2:20 am
Completed: Monochrome Valentine
Projects: Softwar
Deviantart: raseru09
itch: ZanKizuna
Location: Manilaaaaaaaa
Contact:

Re: Tilemap (Creator-Defined Displayable)

#30 Post by zankizuna »

The sidekick following around can be pretty hard.
Let me try to explain.
Assuming our player is at the true center position:
Depending on what key is clicked, there will be a resulting reaction from the sidekick, in position and direction.
Sidekick should always be behind the player, so when you move north, he/she also moves north
They will execute the previous movement you made.


We should be recording which direction was clicked before. That's what the sidekick should use as a reference to what direction he/she should face to.

Include sidekick in the same screen where the player image is. Sidekick has multiple directional sprites, a dynamic displayable with Player's previous direction to change direction

give the sidekick an "at" statement that references a transform you define that has variables whose values change upon movement .

When you press up, the sidekick will be on south of the player, left, then they go east. And so on.

We are only making an illusion of movement as only the tileset background is actually moving.

Good luck uguu
Will try to code this too if i get time on PC.
Hihi

Post Reply

Who is online

Users browsing this forum: No registered users