Log In  

Cart #19611 | 2016-04-05 | Code ▽ | Embed ▽ | No License
2


Update v0.9
added ability to pickup pizzas
picking up pizzas add 1 to score
added rocks
picking up rocks remove 1 from lives
added spawning mechanism for pizzas and rocks
added sin movement for pizzas and rocks

*added timer -- currently not counting down

added flame and smoke when moving
added downwards force to rocket

added static Boss and Minions
animated Boss health bar

Cart #19520 | 2016-04-01 | Code ▽ | Embed ▽ | No License
2


Hello people!

I have started playing with pico8 for the first time now, and I have been enjoying it very much.

The idea for this game is that you are a rocket flying through space, collecting pizzas.
You will need to avoid obstacles, or shoot them with your collected pizzas.
You can see what I've done so far up there in the cartridge ;)

I am now stuck. I have figured out how to have collision detection with the floating pizzas, but I can't figure out how to "destroy" them, aka picking them up and then adding to the score. Also I want some kind of mechanism that randomly spawns these pizzas, which then float to the left. Similar to this I want to be able to shoot pizzas from my rocket, aka bullets.

If anyone can help, that would be amazing!
Thank you!


Edit: Update v0.9

P#19521 2016-04-01 01:45 ( Edited 2016-09-12 20:29)

Hey your game looks really nice! I'm also new to pico-8 but I took a look at your code and had an idea about how to solve the collecting/destroying pizzas problem at least.

The problem with the way you're keeping track of pizzas (or "pizza" I should say since you're only keeping track of one of them right now) is that your pizza never "goes away." It's a global variable called pizza that's always going to be there when your game loop is called so there's no way to tell the program "hey don't touch this anymore."

Instead, try creating a bunch of pizzas. Create an array that's a list of them, e.g. "pizzas = {pizza1,pizza2,pizza3}" assuming you've already created a table for each of those pizzas. Obviously you'll need a slightly different array creation method if you're going to randomly spawn them.

Then, each time the _update() and _draw() functions run you can iterate over the pizzas with a for loop. Whenever you want to "pick up" and "destroy" a pizza, you can increment a score variable somewhere, and remove the current pizza from the array. Otherwise, just continue updating/drawing the pizza.

for pizza in all(pizzas) do
  if [some condition indicating to collect and destroy] then
    score += 10
    del(pizzas, pizza)
  else
    [do whatever you do with the pizza]
  end
end

Hope that helps!

p.s. You'll want your collision function to accept a pizza as a parameter so it knows which pizza it's trying to collide the player with.

ETA: I made some quick edits to my code after I posted this, but whatever is there now is correct.

P#19526 2016-04-01 04:31 ( Edited 2016-04-01 13:20)

Hey BenWiley4000, thank you for your help!
Together with a friend of mine I got it working :)

Now I have to put this project on the side though, other priorities :/
But here is a mockup of a rocket select I'm planning.
Don't know if I can implement all colors yet, but I will see!

P#19612 2016-04-05 19:41 ( Edited 2016-04-05 23:41)

This is looking really nice!! That rocket select screen is neat too!
It seems weird that going too far up and too far down just blocks you and doesn't do any damage. Maybe that's just me though...
Keep it up!

P#19616 2016-04-06 06:19 ( Edited 2016-04-06 10:19)

I really love the art style, nice work!

P#19620 2016-04-06 11:17 ( Edited 2016-04-06 15:17)

Thank you guys!

@TRASEVOL_DOG yeah I've been thinking of removing the bottom bound at least, so that you die when you leave the screen. Probably gonna do something about that!

P#19628 2016-04-06 17:15 ( Edited 2016-04-06 21:15)

a few comments:

  1. nice getting everything working! Looks good.
  2. The downward drop on the rocket is a little puzzling to me. I'm not sure if you're going for a Flappy Bird sort of feel, but it comes off more like a minor annoyance that only slightly gets in the way of an otherwise free-movement game.
  3. I'm told to press "X" to start, but then I expect to be able to use that button to play the game somehow. Instead it takes me to the end of the game before I realize what's happening. Not sure why you're even able to do that.
P#19629 2016-04-06 17:41 ( Edited 2016-04-06 21:41)

@BenWiley4000

  1. Thanks!
  2. I based my idea on the classic helicopter game, where you constantly fall down and push a button to go up. I then thought it would be cool to add forward and backwards movement too.
  3. Basically there are 4 screens: Start screen, main game screen, boss screen and game over screen. And for now, for testing purposes you can go through these screens by pressing "x" to check them out.

Hope this clears up things!

P#19632 2016-04-07 07:30 ( Edited 2016-04-07 11:30)

Ah, that all makes sense.

I think the problem maybe is the forwards/backwards movement then - for me, at least, it makes the game too easy.

As for the x button thing - that makes sense, though if it were a different button than the one you use to start the game I wouldn't have to reboot 2 or 3 times before I can actually play the game without ending it on accident. :)

P#19633 2016-04-07 09:11 ( Edited 2016-04-07 13:11)

It's Pizza ... in space ... Delicious ... I think I've seen Pizza in space only one other time.

https://youtu.be/H9P1aTsxYzw?t=15

P#28421 2016-09-12 16:29 ( Edited 2016-09-12 20:32)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:48:35 | 0.017s | Q:30