Log In  
Follow
Mikimation
[ :: Read More :: ]

I made a function to draw an equilateral triangle that I could animate:

function triangle(_x,_y,_size,_angle,_clr)
 for i=0,2 do
  local _offset=.33*i
  local _x1=_x+(cos(_angle+_offset)*_size)
  local _y1=_y+(sin(_angle+_offset)*_size)
    line(_x1,_y1,_clr+i)
 end    
end

Pico 8 does something weird when I try to draw 2 triangles made out of lines:

I can draw each triangle just fine, but when I put the triangle() function twice it weirdly connects the triangles.

I have no idea why it does that, I could use some help.

here's the full code

function _init()

end

function _update()

end

function _draw()
 cls()
    triangle(64,64,30,0.255,8)
    triangle(64,64,30,0.255+0.5,12)
end

function triangle(_x,_y,_size,_angle,_clr)
 for i=0,2 do
  local _offset=.33*i
  local _x1=_x+(cos(_angle+_offset)*_size)
  local _y1=_y+(sin(_angle+_offset)*_size)
    line(_x1,_y1,_clr+i)
 end    
end
P#149896 2024-06-13 14:51

[ :: Read More :: ]

So I logged in recently to check my game here, and I see now that the death animation is totally broken. the death animation loops when it shouldn't and the fadeout animation is really slow.
I have on my PC the version I downloaded a year ago, and the game is working fine on that version.
Was there something that changed with how Pico8 calculate things?

Link to my game The World Under
https://www.lexaloffle.com/bbs/?tid=48726

P#148177 2024-05-09 14:59

[ :: Read More :: ]

Cart #worldunder-11 | 2024-06-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
31

The World Under

a game by Mikimation aka Miki Hakim

Controls:

Left\Right - Walk
Up - Interact
Down - Defend
Z - Attack
X - Jump
Down + X - Roll Dodge

Dev notes

I am an animator by profession. I've had a big project this year in After Effects that made me required me to learn some programming. Around that time I discovered Pico 8 and fell in love with the platform and a lot of the games made by the community. I decided I want to fulfill a dream I've had for 20 years now and make a game, like the games I used to grow up on in the 90s.
I've started doing some tutorials, and what started as a small project developed into making a full-on game.
I have learned a lot through the process. With each mechanic I wanted to put on the game I needed to learn more about programming in Lua and math.

After I set up the engine, I found out what game design really is. Working with Pico 8's relatively small map, I've understood how I should lead the player in the area, and use the space to its maximum potential.
I also had to learn technincs used by early games, such as pallete swapping, used in the sword animation, fade to black screen, and different level colors.
Creating systems was really fun. Like the enemy system, and building modular enemies with modular ai. With these systems I could create a big amount of enemies while using a rather little sprites in the process.
To be able to put alot of contents in Pico 8's code limitations, I've developed all kinds of compression methods that really let me squiz in alot, though I've had to let go of alot of ideas that I wanted to put in.
The game is not perfect, but it's my first game, and I know you gotta stop at some point and move on to the next project. I did manage to create a full game, and I'm really proud of how The World Under came to be.

about the code

For an efficient way to place enemies on the map, I've made a script that scans the entire map, and look for tiles that will spawn enemies(first tab after the comment "map scan for enemy tiles".

controls are all shared by the enemies and the player, in order to save code tokens. It surprised me how well it worked out.

Actors management. the function create_enemies on the 4th tab is the properties of each actor(powerups, enemies, NPCs, etc...). Each actor has a type, and according to it's type, it gets it's custume properties, such as sprites, width, height, ai etc...

The Ai of the enemies is also modular, as each block of the ai can be called with it's name, in the AI table.

sprite_builder() is the function that builds each enemy from different sprties and handles it's animation properties. Took me some time to get it to work well, and I was able to do with some really amazing enemies.

In conclusion This game was really fun to made and I hope it will be fun for you to play

P#115100 2022-08-01 12:27 ( Edited 2024-06-09 19:17)

[ :: Read More :: ]

The game I'm working on "The World Under" is 95% done!
I'd love to collab with a musician and have music for my boss fights. Can be music that was already made aswell

P#114787 2022-07-25 09:10 ( Edited 2022-07-25 09:13)

[ :: Read More :: ]

I'm trying to make a radial sight function for the enemies in my game

I want them to know if the player has entered a radius around them, and be able to control the angle of their sight according to their direction
So basically it's checking if the player has entered a sector of the radius around them, and also being able to control the percentage of the sector and its direction.

I thought about splitting the radius around them into directions, as seen in the image. I'm not sure if that's right.

I'm terrible at math so I couldn't figure this one out, I'd appreciate the help

this is the closest solution that I found, but I couldn't make it work
https://www.geeksforgeeks.org/check-whether-point-exists-circle-sector-not/

P#108590 2022-03-14 10:34 ( Edited 2022-03-14 10:37)

[ :: Read More :: ]

I'm trying to make a tentacle using sin().
I want the base (the top circle) to be static, and the wiggle of the tentacle to get stronger until it reaches the tip (the bottom circle).
So far I have only achieved a pendulum
I'm not that good with math so I'm not sure about how to do it
here's my code

function _init()

length=20
x=64
y=40
end

function _draw()
cls()

 for i=0,length do
 circfill(x+sin(time())*i,y+i*4,length-i,14)
 end

end
P#103517 2021-12-25 10:11

[ :: Read More :: ]

I'm working on a platformer game. I'm having an issue with enemy AI.
I want that the enemy will turn the opposite way once it reaches a cliff, much like a collision with a wall.
I want to make a collision check that will check if the floor of the tile after the enemy doesn't have any flags.
How do I do that if 0 means the first flag?

P#103187 2021-12-20 17:10 ( Edited 2021-12-20 17:10)