Author Topic: {AP} Dodgeball  (Read 13863 times)

0 Members and 1 Guest are viewing this topic.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
{AP} Dodgeball
« on: November 29, 2008, 11:25:22 pm »
If you've been checking out my Game Info & Progress... you know I'm taking a short break from making Nyaar.
I decided I'll try out a simple action game.
Multiple moving objects was my main goal... and so far, I've psuedo-accomplished this.

So, what better test than dodgeball. From all sides.
So far, I have two directions, simple look, no real interface... but I've only been working on it for... maybe an hour and a half at most.
All BASIC and xLIB's 'drawsprite' function. (via Celtic III)

Here's a screenie of the progress so far. (kinda slow... really flickery)

(It's actually a bit faster than this... I used WabbitEmu's GIF capture for this one.)

Newest Screenie:


Download for latest version below.
« Last Edit: November 30, 2008, 10:13:51 pm by {AP} »

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Test Project
« Reply #1 on: November 29, 2008, 11:29:09 pm »
How many objects are you hoping to be able to have without excessive slow down?
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Test Project
« Reply #2 on: November 29, 2008, 11:33:43 pm »
As many as I can without excessive slow-down. =D
I'm just going to keep pushing the limits until I can't anymore.

Also... I made it not flicker as much now. (random epiphany)


Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Test Project
« Reply #3 on: November 29, 2008, 11:38:26 pm »
What method are you using?  Do all of the balls move per frame or are you iterating over them?  All of my (poor) attempts at simultaneous movement go horribly horribly wrong with more than 4-5 objects.  I'd be interested to see how fast you can get it. :)
[edit] I just thunk of something that might possibly work for those darn spiders in CC...
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Test Project
« Reply #4 on: November 29, 2008, 11:39:54 pm »
Each time the Repeat goes through, it moves all the balls in the direction they need.

(EDIT: I have 4 going now. One from each side of the screen. Only issue now is the slow response on key presses.)
« Last Edit: November 30, 2008, 12:04:08 am by {AP} »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Test Project
« Reply #5 on: November 30, 2008, 03:01:35 am »
quite fast so far. Just one thing tho, to erase the screen I would recommend against erasing everything if you are gonna have a HUD. Use rectangles to do so, that way you will not need to redraw the HUD every frame like i did in my old games, which slowed them down a lot x.x

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Test Project
« Reply #6 on: November 30, 2008, 03:05:04 am »
No problem, the balls are XOR'd and the character is OR then XORd.
The reason the character is done that way is so it only erases during a keypress (getting rid of him flashing repeatedly).
Now that I think of it though, I'll try handling the balls the same way as the character... might be better.
« Last Edit: November 30, 2008, 03:23:43 am by {AP} »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Test Project
« Reply #7 on: November 30, 2008, 03:20:41 am »
well if you mean you xor every ball everytime to erase them this might slow the game downa  bit too, especially when you will have many balls at once.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Test Project
« Reply #8 on: November 30, 2008, 03:27:35 am »
Well, how I draw them is by XORing them in (updating LCD) then XORing them out immediately after (don't update LCD).
It's how I did all of my menus. That way it looks like it's still there and is still there according to it's location, but I don't have to do any checks or anything to get things working.

Unexpected test result. It turns out that if you run at a ball straight on... you'll dodge it.
It has to do with the fact that the code checks if you and the ball occupy the same spot.
Example (ball = O; player = X):

O


X

O
X

X
O

X


O

Those are the exact locations after each run through of the game loop.
So they never actually occupy the same spot.
Though it still looks like you should have been hit.

I can't honestly think of a way to fix this either...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Test Project
« Reply #9 on: November 30, 2008, 08:55:47 am »
yeah I got this problem many times in my games before. I think Zelda Dark Link Quest TICF still does that. I am unsure about how to fix it without losing too much speed. Usually you would need to check for collision detection when the ball moves then re-check collision detection once again when you actually move

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Test Project
« Reply #10 on: November 30, 2008, 03:04:35 pm »
How about checking for collisions with the ball's current position and the player's previous position?
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline necro

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1295
  • Rating: +17/-2
  • +3 vaporal mustache
    • View Profile
Re: Test Project
« Reply #11 on: November 30, 2008, 03:35:04 pm »
could simply make one check each time the player moves, and have a check for each time the balls move.  Is your collision list or matrix based?
I'm like a woot burger with awesome fries


VB.Net, C#, C++, Java, Game Maker

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Test Project
« Reply #12 on: November 30, 2008, 05:25:46 pm »
Actually, I have a variable based system.
The others seem like they'd take away a lot of extra space and probably speed too.
Though, I'm not positive.

Well, here's progress so far.


Which brings me to my next weird problem.
As you can see in the second play through, after "Not a highscore" was displayed... it said 'Done' and finished which is weird because it's set up like this.
Code: [Select]
If (you didn't get a highscore)
Then
Disp "NOT A HIGHSCORE."
Pause
Else
(Processes highscore changing)
End
Goto (starting menu)
Lbl Q    //Lbl for the 'quit' option from the menu
ClrHome
Output(1,1,"
As you can see... getting a highscore is cool.
But if you don't... it just Stops the program for some reason.

(EDIT: Found the problem... missing End.)
« Last Edit: November 30, 2008, 05:34:33 pm by {AP} »

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Test Project
« Reply #13 on: November 30, 2008, 05:35:54 pm »
Does it go back to the main menu when you do get a high score?
I'm thinking you're probably missing an 'End' somewhere.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Test Project
« Reply #14 on: November 30, 2008, 05:38:30 pm »
Yes.
Though, I fixed it so it does whether or not.
It was a missing End... >_<

Anyway... everything's cool now.
Still, wish I could make the keypresses more responsive.
No luck on optimizing that yet.