Log In  

@Firebird

Follow
Follow

Cart [#gamuretihi-0#] | Code | 2019-08-16 | No License | Embed
3

I decided to make a space invaders clone in pico-8 over the weekend. I've been having a bit of trouble with a weird collision glitch that only happens when my Alien entities react to colliding with the right side of the screen. I've Worked through the logic in my head and my code should work. I've tried numerous variations of what I currently have in my cart thinking that maybe there is something with the code execution that is causing it to be off.

I'm pretty sure that the problem is related to the bit of code below. However, I'm not 100% sure since I haven't been able to fix it yet :-)

update = function(self)      
  if(self.x <= 0) then
    adr = 1
    self.x = 0
  elseif(self.x >= 120) then
    adr = -1
    self.x = 120
  end
    self.x +=self.v*adr             
end

Please direct me towards a solution if you can. This type of collision detection is usually pretty straightforward to do, but I've spent more time trying to fix this bug than I've spent making everything else.

[Edit]
I was able to fix the problem by moving the collision detection into a different loop to separate it from the position update so that the direction wouldn't be changed before all the entities had finished updating.

Cart [#zitomarufe-0#] | Code | 2019-08-16 | No License | Embed
3

P#66686 2019-08-16 00:51 ( Edited 2019-08-16 20:01)

Have any of you used the Pyxel fantasy console? I just found out about it this week and I think it could possibly be made to work on the adafruit pybadge. It was designed to be a python substitute for Pico-8 and the creator cites pico-8 as his main inspiration for making it. It’s open source and could probably be made to run on the adafruit pybadge. There are a few developers working on a pybadge port of Celeste/pico-8 carts, but I haven’t found any more information about that project except for a few social media pictures and a GitHub repo. If the Pico-8 port to pybadge never happens then pyxel could be a possible substitute.

Here is the link to the Pyxel fantasy console: https://github.com/kitao/pyxel

Pico-8 is always my first choice for a fantasy console, but if it won’t be available on the pybadge then pyxel may be an acceptable substitute.

P#64731 2019-05-25 03:33 ( Edited 2019-05-28 03:57)

Cart [#zohasaberi-8#] | Code | 2019-05-13 | License: CC4-BY-NC-SA | Embed
2

I figured out how to use distance formulas to determine if a point lies within a non-orthogonal rectangular region. I can see many possible applications of this and thought I would share my solution. I'm sure there is a more efficient way to do this, but this is the best solution I could come up with at the time that didn't involve vector math. I tried to comment my code to help people understand it better, but I didn't go into great detail with explaining the math. Anyway, It only took me about an hour to come up with this demo but I hope someone can find it useful.

P#64361 2019-05-13 07:50

Cart [#nazubukiho-0#] | Code | 2019-03-08 | License: CC4-BY-NC-SA | Embed
4

I wanted to do something new and interesting. After searching around the BBS, I found that nobody had published any strange attractors(I love strange attractors) so I decided I would be the first. I created a Lorenz attractor visualizer in java a few months ago so I decided to port it to pico-8. Then this week just as I started working on my Lorenz attractor I saw this. I can't believe It. Anyway, since Mattias beat me to a Lorenz, I will make a Rössler attractor.

I'm still pretty new to pseudo 3D, pico-8, and Lua in general so I will use the 3D plotting engine Mattias made until I can finish porting mine :P

Important Notice:
This spinoff will officially reserve the position of first Rössler attractor made/published in pico-8 :)
It will eventually be replaced with my own engine.

Do any of you know of any good resources I can use to learn about 2D to 3D projections and other pseudo-3D related stuff? I rarely do anything with 3D and the little I have done used 3D engines like OpenGL.

P#62677 2019-03-08 06:46 ( Edited 2019-03-08 06:56)

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-08-19 19:47 | 0.071s | 4194k | Q:60