Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 17th, 2005, 11:50 AM   #1
Enkiel
Newbie
 
Join Date: May 2005
Posts: 2
Rep Power: 0 Enkiel is on a distinguished road
Array help (game)

Ok, well I am fairly new, and I am working on that game where you are the paddle at the bottom of the screen and you break the blocks at the top of the screen. I am trying to put those blocks on an array, and make them "invisible", or basically gone when they are hit, however when they are hit, it seems to me that random ones disapear. Also when the blocks are all gone it gives me a "there is no element whatever integer" error kinda thing, I am kinda lost here, does anyone know how to explain arrays to someone who doesn't speak 10100010010101010110?
Enkiel is offline   Reply With Quote
Old May 17th, 2005, 12:24 PM   #2
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
Oh one of those people! You probably won't find many round here...

0x42 0x79 0x65, 0x42 0x79 0x65
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old May 17th, 2005, 12:25 PM   #3
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
i think that's right, i'm not too good at hex (for those who are reading)
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old May 17th, 2005, 1:49 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I'm not to keen on the object collision algorithm you would use.... but for starters... You can preset all of the positions of the array representing the blocks to 1. Then, you can set the visible property of the component to false when it is hit and set the position in the array that represents that spot to 0. This will allow you to "skip" the blocks that have already been hit... hitting the next block in the ball's path. I think this is an old game called Paddle Wars for Atari that does this.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old May 17th, 2005, 2:08 PM   #5
Enkiel
Newbie
 
Join Date: May 2005
Posts: 2
Rep Power: 0 Enkiel is on a distinguished road
To tell the truth I really suck at arrays, no one can put it into stupid terms for me, lol you just said abaabababalahab. Haha, thats about all it meant man, dumb it down, by this I mean when you say "position of the array" I say position?
Enkiel is offline   Reply With Quote
Old May 18th, 2005, 2:20 PM   #6
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Are you using an array of VB shapes on a form, or simply an array of coordinates and drawing them yourself? I suspect that you're using shapes, as you wouldn't get this error otherwise. If you draw the whole thing using GDI for example you'd get better refresh rates, and none of the redraw problems of VB. Plus, when you get on to it, you could add custom variables for each block like mass, friction etc to the Type definition. Collision detection's a whole lot easier as well.
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC