Log In  
Log In  

@andylatham82

Follow
Follow

Cart [#bezierball-3#] | Code | 2019-03-22 | License: CC4-BY-NC-SA | Embed
1

Edit: Above is a new version with better collision. Many thanks to @bridgs

Original below:

Cart [#bezierball-0#] | Code | 2019-03-22 | License: CC4-BY-NC-SA | Embed
1

Hello! I recently created a [bezier curve.] https://www.lexaloffle.com/bbs/?pid=62928#p

I decided to see if I could make a ball interact with it, and it turns out I can! It's not perfect - it's possible for the ball to move through the curve in certain circumstances. I think my collision detection needs to be more robust.

P#62950 2019-03-22 09:12 ( Edited 2019-03-22 14:34)

Cart [#bezier-0#] | Code | 2019-03-21 | License: CC4-BY-NC-SA | Embed
1

Hello! I knocked this up in a few hours and I hope it's useful to someone. It draws a bezier curve based on the positions of four points: a start and end point, and two bezier handles.

The user can move any of the four points around by using Z to cycle between them and the arrow keys to move.

I have wrapped up the bezier into a single object so hopefully it should be easy to re-purpose.

P#62928 2019-03-21 08:32 ( Edited 2019-03-21 08:32)

Hi,

I'd like to create a top-down adventure game with a map that will exceed the dimensions of the map editor, so I'd need to create and store the map by other methods. The problem is that I'm a bit clueless about how to best go about this and wondered if anyone could send me down the right path.

I'm guessing that I'd basically have to store the map in an array (well a table). Does anyone have any experience with doing this kind of thing?

Thanks!

P#26367 2016-08-03 06:32 ( Edited 2016-08-03 16:48)

Cart [#26324#] | Code | 2016-08-02 | License: CC4-BY-NC-SA | Embed

Hi!

I'm trying to make a reusable platform game engine in the style of Super Mario Bros or Sonic the Hedgehog etc. I've just finished putting something together and I'd love to get any opinions on how it feels or ways to make it better. The graphics are extremely basic because I'm just focusing on the mechanics for now.

My biggest problem with it is in making jumping through platforms feel nice. Currently if the bottom of the player is intersecting a floor tile, the player is moved above it to stand on it. However this results in the player being put up on a platform when it doesn't feel like he should be. I'd like to make it so that a platform is only detected when the player's feet just slightly intersect it by up to half a tile.

Controls:
Arrow keys to move
"Z" key to jump

Features:
-Horizontal and vertical acceleration
-Friction
-Gravity
-Capped speeds
-Floor detection
-Variable jump height based on length of time button is held
-Variable jump height based on horizontal speed of player at time of jump

It seems to run slower in a browser than in Pico-8. My code isn't currently very efficient, perhaps that's the reason.

P#26325 2016-08-02 11:01 ( Edited 2016-08-19 10:51)

Hi,

I'm trying to put together the physics of a classic platform game in Pico-8. I want to achieve something that behaves like Super Mario Bros.

I have coded a jump system where when the player presses jump, the character rises by a set number of pixels each frame, with that number decreasing every frame, so the character slows down as he gets to the top of his jump. This works well, but I run into problems when I try to implement a variable jump. Like Mario, I'd like my character's jump height to depend on how long the jump button is held down. I did achieve this simply by cancelling the vertical climb when the button is released, but this means that the jump doesn't slow to a halt unless the button is held long enough to see the full jump.

I suspect I'm going about the whole thing in the wrong way and wondered if someone can tell me how the guys at Nintendo did it with Mario. I'm sure there are lots of ways of achieving something similar, but I'd like to know how it was achieved on the NES if possible as I'm as interested in the technique as I am in the end result.

Some Googling suggests that the best method to use is by setting up forces acting on the character. Is this how it would have been accomplished back in the 1980s?

Thanks for any help! :)

Andy

P#26259 2016-08-01 08:44 ( Edited 2016-08-02 14:06)

Hi, I've been looking through the Pico-8 manual, and found this:

The bottom half of the spritesheet and bottom half of the map occupy the same memory.

What uses can this have? I can't really think of anything personally but there must be some.

P#25610 2016-07-20 09:03 ( Edited 2016-07-20 13:58)

Cart [#25597#] | Code | 2016-07-20 | License: CC4-BY-NC-SA | Embed
4

I made this bit of code for creating a parallax effect for side-scrolling games. It uses three layers of infinitely repeating maps. I've set it up so that all the code is in a self-contained section that can be copied and pasted below your own code, with just an initialise, update and draw function needing to be called from the respective functions in your game.

More complete instructions can be found in the header of the code.

I hope somebody finds it useful!

:)

P#25598 2016-07-20 04:33 ( Edited 2016-07-20 13:42)

Cart [#25546#] | Code | 2016-07-19 | License: CC4-BY-NC-SA | Embed
2

Hi,

I'm a bit of a beginner where programming is concerned, but I'm trying to work out how best to create an infinite scrolling background for a side-scrolling shooter game.

I figured that the way to achieve this would be to make a screen full of sprites and move them to the left, deleting them once they are off the screen and replacing them with new sprites on the right. I have managed to achieve this, but I don't think the performance is that great. It doesn't feel very smooth.

Am I doing it the right way? Is there a better way?

Thanks for any help you guys can give!

--tile scrolling

function _init()
    tile_h={} --horizontal tile strip

    --spawn 16 tiles in strip
    for i=0,16 do
        spawn_tile(i*8,0)
    end
end

function _update()
    foreach(tile_h,update_tile)
end

function _draw()
    cls()
    for i=0,16 do
        foreach(tile_h,draw_tile)
    end
end

function update_tile(t)
    t.x-=1 --move tile to left

    --if tile off edge of screen
    if t.x<-8 then
        del(tile_h,t) --delete tile

        --add new tile to right
        spawn_tile(16*8,0)
    end
end

function spawn_tile(x,y)
    local t={}
    t.x=x
    t.y=y
    add(tile_h,t)
end

function draw_tile(t)
    --draw 16 tiles vertically
    for i=0,16 do
        spr(1,t.x,t.y+i*8)
    end
end
P#25547 2016-07-19 10:10 ( Edited 2016-07-19 18:03)

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-05-22 06:43 | 0.080s | 4194k | Q:82