Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Problems with arrays

Author
Message
Wyrmslayer
20
Years of Service
User Offline
Joined: 13th Nov 2003
Location:
Posted: 12th Dec 2003 17:14
[img]hey im in highschool gamedude's class and we both are working on a tron like game however i cant seem to get the game to goto the kill area when it hits one of the dots and i was wondering if anyone had any ideas.i cant get my pic files on here but i hope anyone can put something in to work
Any help will be highly appriciated.

Maybe blasting this quadrent of space into a swirling hellstorm of flaming nothingness will cheer me up.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 12th Dec 2003 23:31
You could store the dot positions....

Wall(1,1) = x2
Wall(1,2) = y2
dot x2,y2

Pincho.
Wyrmslayer
20
Years of Service
User Offline
Joined: 13th Nov 2003
Location:
Posted: 15th Dec 2003 16:43
thank you pincho however im a newby and im not quite sure what you mean if u would,please elaborate on the wall thing. thanks again


Maybe blasting this quadrent of space into a swirling hellstorm of flaming nothingness will cheer me up.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Dec 2003 17:08 Edited at: 15th Dec 2003 17:08
you are drawing dots on the screen, and each dot has an X/Y coordinate. You need..

Dim(How many dots,2)

Rem......This is like .. Dim(400,X,Y)

As your motorbike draws a dot store it in the array.

You then use a distance formula to see if you hit the dot.

You could also put a sprite on top of the nearest dots for collision.

Actually...you could create screen zones wherever a bike travels. A screen zone is a rectangle area, with an X1/Y1 X2/Y2 top left/ bottom right rectangle. These zones are like invisible collision areas usually used for buttons. But it would be quite easy to use them for invisible walls. Or you could just make collision boxes. The best way to learn zones, is to make a button that you can click on. You will probably need buttons in your game anyway.

Pincho.
Wyrmslayer
20
Years of Service
User Offline
Joined: 13th Nov 2003
Location:
Posted: 16th Dec 2003 16:56
thanx for the help

As a supervillian i swear to never gloat before killing the Hero.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 16th Dec 2003 17:16
I'm making something similar to this. I'm making Breakout, and it has squares all over the place as bricks. I have found that you only need the X/Y coordinats for the collision. You don't need X1/Y1 X2/Y2. Once you have the X/Y coordinates you already know the radius of each dot.

Login to post a reply

Server time is: 2024-05-02 07:30:47
Your offset time is: 2024-05-02 07:30:47