Log In  

Please if anyone can help me, please help me with the sprite and how to make it clear instead of blue and when it collides with the blocks.

P#123952 2023-01-08 16:57

Sorry that I cannot help hand in hand with your game, but I have some suggestions for you.

  1. Sprites

The 2nd option on top of editor mode tab is the Sprite Editor.

After entering the editor, just first click an 8x8 empty space (normally the one on the right of "x") to freely create your character, then leave the other tiles for background, tiles, and coins etc.

Each 8x8 sprite has a number like 1, 2, 3, which is useful in importing sprite in main editor with spr().

Also, each has a flag (the 8 dots on the right). Explore a bit and use flag to set solid surfaces etc.

One another point: apart from sprites, you have to make use of Map Editor as well. Then using necessary codes including map(), mget(), fget() to make up a whole game structure.

Trick: when editing, press Ctrl+U on selected codes to get relevant information.

For further information, see here.

  1. Make it clear instead of blue (?)

What exactly does "it" refers to? Please comment to make it really clear.

  1. Collision

Well, I haven't made a platformer. But I can share some codes here:

function collid(x,y,con)
    local x1,x2,y1,y2=0,0,0,0
    local cflag=0

    if con==⬅️ then x1,x2,y1,y2=x,x-1,y,y+7 end
    if con==➡️ then x1,x2,y1,y2=x+7,x+8,y,y+7 end
    if con==⬆️ then x1,x2,y1,y2=x,x+7,y,y-1 end
    if con==⬇️ then x1,x2,y1,y2=x,x+7,y+7,y+8 end

    if fm(x1,y1,1) or fm(x2,y1,1) or fm(x1,y2,1) or fm(x2,y2,1) then cflag=1    end
    return cflag    
end

This function will return a value (0 or 1) indicating whether two sprites collide each other.

Using the function, you can then add more events like standing on solid ground, climbing and getting coins.

P#133148 2023-08-16 16:03 ( Edited 2023-08-16 16:09)

[Please log in to post a comment]