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

P#34964 2017-01-04 22:08 ( Edited 2017-01-07 16:04)

Nice work, feels very polished!

P#34970 2017-01-04 22:43 ( Edited 2017-01-05 03:43)

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

P#34975 2017-01-05 02:14 ( Edited 2017-01-05 07:14)

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.

P#35005 2017-01-05 15:58 ( Edited 2017-01-05 20:58)

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!

P#35006 2017-01-05 16:14 ( Edited 2017-01-05 21:14)

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
}
P#35043 2017-01-05 21:19 ( Edited 2017-01-06 02:19)

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!

P#35050 2017-01-05 23:15 ( Edited 2017-01-06 04:15)

Yeah this is absolutely begging for mouse control!

P#35051 2017-01-06 00:44 ( Edited 2017-01-06 05:44)

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

P#35054 2017-01-06 01:29 ( Edited 2017-01-06 06:29)

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 :)

P#35098 2017-01-06 14:45 ( Edited 2017-01-06 19:45)

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

P#35111 2017-01-06 17:19 ( Edited 2017-01-06 23:38)

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

P#35114 2017-01-06 17:22 ( Edited 2017-01-06 22:22)

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?

P#35145 2017-01-07 07:32 ( Edited 2017-01-07 12:32)

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

P#35155 2017-01-07 11:03 ( Edited 2017-01-07 16:03)

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.

P#35156 2017-01-07 11:04 ( Edited 2017-01-07 16:04)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:39:22 | 0.013s | Q:28