Login
Community
DARK THEME

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!

eg. speedx=speedx*0.9

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

:embed https://microstudio.io/mrderry/spacebattle/

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 !

@mrderry

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.

eg.

recttorectcol=function(x1,y1,w1,h1,x2,y2,w2,h2) // Collision between two different rectangles
  xdist=abs(x2-x1) // Distance between midpoints
  ydist=abs(y2-y1)
  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...
  end
end

circletocirclecol=function(x1,y1,r1,x2,y2,r2) // Collision between two different circles
  dist=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
  if dist<r1+r2 then // Distance between midpoints is smaller than sum of radius's
    intersected=1
  end
end

@tinker_guy

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.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community