mr.derry's Arcade Games
My first venture into games in microStudio will a space battle game, not surprisingly call Space Battle! Two ships in zero gravity, main thrusters and retros on the Up/Down, rotate ship on the left and right. Second player uses TFGH instead of WASD. World wraps around. Simple weapons. That's it.
Great! Can't wait to see it :)
Cool! Maybe add moving asteroids and alien ships to spice things up :-)
Yup, that's the logical progression ;)
Think I will preview it early to get feedback on some things, though.
Well OK I have published this working version of Space Battle. Feedback encouraged!
Really nice job! I like the ship designs and the feel of the controls! - although perhaps adding some friction would be good - this can be done by multiplying the speedx and speedy of the spaceships by a friction value between 0 and 1. I kept flying out of control, :P!
Quick question, how do you shoot (using the energy projectile weapon)? I think I've tried every button?
Also, you can embed the project like this:
: embed https://microstudio.io/mrderry/spacebattle/ but without the space after the colon :)
Takes me back to the old arcade games for sure!
Woah, nice job :)
P.S. @that_guy_missed_it , ... regarding the keys,there is a doc ... hehehe ;)
But back to the game, nice job, I need to dig my way through the code, looks like a lot I can learn.
Especially the way you do the collision check, have to look into that :)
At the moment decreating (... hopefully not desecrating, LOL) @that_caster_guys demo, your's will be next on my list.
I am hoping the collision detection is working correctly. It doesn't look quite right, but without breakpoints for debugging it's hard for me to check. This game was written from scratch and I make good use of the class structure to achieve lots of functionality with less code.
Thanks for the reply and happy de-creating !
Looks like I... erm... missed the doc so don't mind what I said about the shooting. However, I still think having some kind of friction would still be a great idea.
And about the collision - after a quick check of the code it looks like you are looking for very precise collision. Though the method seems quite interesting, if it doesn't work then maybe using rect to rect collision or circle to circle collision would be easier. Although it would not be as precise, it would still be 'good enough', especially if you use multiple rectangles or circles in each ship's hitbox. That's certainly what lazy coders like I do haha.
recttorectcol=function(x1,y1,w1,h1,x2,y2,w2,h2) // Collision between two different rectangles
xdist=abs(x2-x1) // Distance between midpoints
if xdist<w1+w2 and ydist<h1+h2 then // Distance between midpoints is smaller than sum of widths/heights
intersected=1 // not sure if this will work but in theory...
circletocirclecol=function(x1,y1,r1,x2,y2,r2) // Collision between two different circles
if dist<r1+r2 then // Distance between midpoints is smaller than sum of radius's
How are you going with desecrating... hehe... my raycaster? Do you have any questions so far?
About the collision detection... yes I wanted something fairly accurate, that would take into account the shape and the angle of the ship.
So I thought I would make a my own bitmap of the ship, and then generate versions for each angle possible. As it turns out, I need only map tables for angles 0 to 45, because I can synthesis the all other bitmaps by careful manipulation of the table access, through mirroring and angle reflection.