Log In  


Cart #35115 | 2017-01-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

A minimalistic version of Missile command made with my son as a programming project

6


Nice work, feels very polished!


Wow thanks! Still a lot of improvements in mind for it. :)


Awesome start. I'd go ahead and add mouse/touch support and you're even more golden. Then you could even play it on the PocketCHIP nicely.

Love the city sprite with the CN Tower thing.


I didn't know there was such a thing as touch support, I did see something about mouse by poking a specific memory location. Definitely the most requested feature :)

My son got a PocketCHIP for christmas and uploading the cart here was our way of testing it. We got the little SNES controller working after some linux fiddling and it plays decently well on the pocketCHIP with the gamepad.

Thanks for the tip!


Here's the mouse/touch code I use in my games, works pretty well. I found it in another thread and just abstracted it a bit more.

It will give you X/Y of pointer and return if a button is pressed. You can wrap that into your functions if you have hot spots on the screen or whatever.

-- mouse/touch detection and handling
-- muse load mouse.init() at boot
-- mouse.pos() returns x/y of mouse position
-- mouse.button() returns button ID, see below
mouse = {
  init = function()
    poke(0x5f2d, 1)
  end,
  -- return int:x, int:y, onscreen:bool
  pos = function()
    local x,y = stat(32)-1,stat(33)-1
    return stat(32)-1,stat(33)-1
  end,
  -- return int:button [0..4]
  -- 0 .. no button
  -- 1 .. left
  -- 2 .. right
  -- 4 .. middle
  button = function()
    return stat(34)
  end
}

What a great port of missile command! Love the sound design :) I would just make the difficulty ramp up a bit quicker for a real challenge.

Thats really cool that you built this as a project with your son!


Yeah this is absolutely begging for mouse control!


Nice! Now I don't have to work on my version of this anymore. :)


Wow you guys are all so supportive, I'm proud to say my son did all the art and sound. Glad you are enjoying it. Thanks for the code snippet morningtoast, I'll post an update for the cart soon.

radcore: yep, more waves where the ICBM's speed up is on the feature list :)


Cart #35115 | 2017-01-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Here's an updated version with mouse and 60fps support, I assume it also has touch support but need to test it on the pocketCHIp


Looks like that works on the PocketChip, need to give it a title though!


Awesome! Just had a go of the new version. Nice work on mouse control. At the end I was just rushed by the missiles (roughly 10-20 * speed). Did I run out of shots? Is that a feature?


Yeah! When your last missile has exploded if there are still incoming ICBM's they speed up and you watch your cities burn :)

There are ~10 waves of ICBM's, if you clear them you "win" and get 20 bonus points for each unused missile you have left.

Scoring and multiple missions are very much WIP


morningtoast : I used your mouse code (thank you!) but was able to remove the line with local variables from the mouse.pos() function without any affect on the functionality.



[Please log in to post a comment]