Game Programming :: Multiple Platform Collision Detection

Jan 12, 2010

Lately I have been making a platformer game, just to experiment and see how it would work, and after making two very basic levels I realized that it would take a lot of code to include several or more platforms.

[Code]...

View 4 Replies


ADVERTISEMENT

Game Programming :: Collision Detection For Tile RPG

Feb 25, 2012

I'm trying ot make a top down rpg, or pokemon like game, but I can't find any proper tutorials for collision detection. I have found one, but when I did it it doesn't seem to work properly, and I get errors everytime I go to the edge of the form. What I can do to make good collision detection for walls?

HTML Code:
Public Class Form1
Public Level1 As New clsLevel()
Public Dude As New clsSprite(Level1)
Dim CanWalk As Boolean = True
[Code] ......

View 1 Replies

Game Programming :: DirectX Collision Detection?

Aug 11, 2010

I have loaded two mesh's from .x files onto the screen, a map and a sprite. The sprite moves around, but because they aren't colliding the sprite goes straight through the mountains, and straight over the undulations. I have looked for a way to find the co-ordinates of a particular spot on the mesh, as I figured by finding the X and Z co-ordinates of the sprite, I could just set his Y co-ordinate to be the same as the map, and he would 'stick' to the ground... however I don't know if this is possible, and I haven't found it yet.

View 7 Replies

Game Programming :: VB2008 - Space Invader Collision Detection?

Dec 28, 2010

i've looked up several tutorials on what i should do to create a collision detection, but im not too positive on how to function my ideas and convert them to code.Basically, i'm creating a space invaders like-game that is 2D Mario-themed (sprites used).I am using a panel for my enemies and Mario is being controlled by the movement of arrow keys and space button shoots.The problem is I can not make my bullets collide with the enemies to make them disappear. This piece of code is what i've got so far with the collision detection :

Code:
'*******************************************************************************************************************************************************
' Collision occurs whenever the pctShoot(podoboo) hits any of the enemy
' When blnTrue, both pctShoot and the enemy disappear

[code].....

While I'm at it, i have another question in concern; but this is not really related to collision but:How do you make an object move down automatically using a timer but make it appear randomly?Like any space invader game, the enemies are shooting back at the hero to make it appear more challenging right?(using Visual Basic 2008)

View 10 Replies

Collision Detection For Multiple PicBoxes?

Dec 21, 2011

i have 3 PicBoxes on a form. PicBox1=sprite PicBox2=Block1 PicBox3=Block2 I have figured out sprite movement on key down and have figured out simple collision detection for all 4 sides of Block1. My question(s) are:

is there an ideal way to create a method that can be called to handle the collision for all future PicBox's added instead of writting code independently for each key press and each NewBlock along with all 4 sides of the NewBlocks?If I created 100 PicBoxes as obsticles too create a maze type game for my Sprite to navigate through?

[Code]...

View 1 Replies

Game Programming :: 2D Platform Game Collisions?

Mar 31, 2009

I'm making a game engine, its coming along pretty nicely, but I'm having trouble with collision detection.. This will be a platform game..I'm using GDI+ for my rendering.My rendering engine, basically draws upon a sprite class I wrote, this class is getting pumped into a collection, then I'm using a for loop to draw the images in the collection..

Code: Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Try For i As Integer = 1 To SCollection.Count Step 1 Dim Image As New Bitmap(DirectCast(SCollection.Item(i), clsSprite).Filename)

[Code]...

View 13 Replies

Game Programming :: Detect A Collision With The Edge Of A Form

Oct 2, 2009

I am currently investigating vb gaming and have set up a test project to move an object; it moves fine. The problem is that when it reaches the edge of the form it continues to move and eventually leaves the form entirely. So my question is how do i work out if my object has touched the edge of the form?

View 5 Replies

Game Programming :: Galaga Hit Detection Not Working?

May 14, 2011

I'm having trouble with hit detection in a game i'm working on and can't seem to figure it out. I made another game before that also has hit detection and that works fine but when i tried to translate the code from that one to the Galaga game its doesn't seem to work the same.Heres my code, its all commented so you can see what you need.

Code:
Public Class GameForm
'Player Variables
Dim Direction As String

[code]....

View 2 Replies

Game Programming - Detect The Collision Of NPC's That Load Onto 2d Tile Map From Text File

Jun 25, 2009

I have a question about collision, yes my 2d tile rpg's map collision works just fine, but im having trouble with the collision with my npc's. At the start of the game it loads all the map data from a text file. well it also loads the location and other stuff about the npc's onto the map from a text file. how do i detect the collision of the npc's that were loaded from the text file, i could do collision with hardcoded npc's but i want to avoid hardcoding the game content into the game engine. RESTATING MY QUESTION: How do i detect the collision of NPC's that i load onto my 2d tile map from text file?

View 6 Replies

Best Way For Collision Detection?

Aug 22, 2009

What is the best way for collision detection? I keep trying but I have failed every time.I want my player to not be able to go through my pictureboxes/obstacles from ALL sides.I have 2 player movement down but now I need collision detection. I am trying to save player2's location with a timer using a variable for the location then check if player2 (picturebox2) intersects with picturebox3. If it does then picturebox2 will go back to the location.

View 13 Replies

Collision Detection In .Net?

Nov 8, 2009

I need help with collision detection in visual basic. I am trying to detect when a picture box hits another picture box. The code I'm using is very simple because I'm very much a beginner.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Math.Abs(PictureBox2.Left - PictureBox1.Right) And Math.Abs(PictureBox2.Top - PictureBox1.Bottom) Then
MessageBox.Show("You Are Dead")
End If
End Sub

View 3 Replies

Collision Detection And Bouncing Off?

Apr 28, 2009

I am trying to do simple collision detection in VB.NET using picture boxes, I have a fixed picturebox, (colour Green), and a moving picturebox, (colour Red). I can manage the collision detection OK, but how do make the movingpicture box bounce off the fixed picturebox and at the right angle? In the following code the moving picturebox sometimes passes right through the fixed one, but not everytime.

ublic Class Form1
Private RedXSpeed As Single = 5
Private RedYSpeed As Single = 5

[code].....

View 1 Replies

VS 2010 With Collision Detection?

Feb 23, 2012

Let me just start off saying that I'm generally new to all programming so if my coding is painful to read I understand. I am currently working on a project that relies on perfect or near perfect collision detection, and I'm not sure whats wrong but sometimes the object being moved completly passes through the object it is supposed to collide at. Here's my coding relating to collision detection so far:

[Code]...

Also, the object, toon, is set to jump with a timer at an interval of 45. Any input regarding how I could make the overall collsion detection better or if I didnt provide the right section of code let me know.

View 1 Replies

Collision Detection Not Operating As Intended?

Apr 7, 2012

I'm designing a system to detect whether a projectile arc impacts a stationary square target. However, the detection is very limited and only seems to work if I use a while loop and a very large area, whereas if possible I'd prefer to animate it using a for loop and have the target somewhat smaller.Here's what I have at present:

Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick
If (Not errorState2) Then

[code].....

View 12 Replies

Is There Collision Detection Within Bounds Of PictureBox?

Nov 7, 2011

I am currently working on a game with collisions. I am using a picturebox with an animated gif in the Image property. I am currently using the following function call to detect collision:
pictureboxPlayer.Bounds.IntersectsWith(pictureboxOfBadGuy.Bounds)
When an pictureboxOfBadGuy collides with some of the whitespace of my picturboxPlayer the above line returns true. Does anyone know if VB has detection for images within a pictureBox.

View 2 Replies

VS 2008 : Collision Detection With Graphics?

May 22, 2010

I want to be able to do collision detection with graphics and a picturebox. I have a character that is moving on the screen and I have drawn both the background and the character using graphics. I have put a picturebox in place of the block that is suppose to be like a square which the character has to jump over. How would I do this?

View 6 Replies

VS 2008 Collision Detection With Rectangles?

May 29, 2010

I have two rectangles; a character and a block. The character is suppose to jump onto the block and then either jump off it or walk off it. I am really getting frustrated with this because I cannot get it to work.

View 9 Replies

VS 2010 - How To Work With Collision Detection In VB

Jul 1, 2010

I have two questions.

1- I have two labels on a form, that I want to move randomly in the form. How can I do that?

2- How to work with collision detection in VB?

View 29 Replies

Interface And Graphics :: Collision Detection And DirectDraw?

Aug 28, 2009

I'm using DirectDraw to create a (very) simple little movement game... (so far not really a game, but hey, gotta start somewhere) And I'm having a little trouble with my collision detection... ok, it's probably not conventional collision detection, but I'm just learning so far...I have a few surfaces set up etcetc, and have animated a sprite on a tile based background... but the problem is whenever I collide with a certain tile (which I've set as unpassable) from the top or the left, it screws the position of my player immensely... this is quite a headache as I can't seem to see a problem...

ps. Another thing, I can't seem to be able to open my pictures without using the entire directory.

View 2 Replies

VB2008 - Space Invader Collision Detection?

Dec 28, 2010

Basically, i'm creating a space invaders like-game that is 2D Mario-themed (sprites used). I am using a panel for my enemies and Mario is being controlled by the movement of arrow keys and space button shoots.The problem is I can not make my bullets collide with the enemies to make them disappear.This piece of code is what i've got so far with the collision detection :

'*******************************************************************************************************
' Collision occurs whenever the pctShoot(podoboo) hits any of the enemy
' When blnTrue, both pctShoot and the enemy disappear '*******************************************************************************************************

[code]....

While I'm at it, i have another question in concern; but this is not really related to collision but:How do you make an object move down automatically using a timer but make it appear randomly??Like any space invader game, the enemies are shooting back at the hero to make it appear more challenging right?

View 3 Replies

Player Movement/collision Detection/global Variable?

Dec 7, 2010

how to do collision. my previous attempts involved trying to see if the player was touching -any- non-collidable object, but i've reversed it so that objects themselves detect if the player is interacting with them and respond appropriately. i still cannot find a way to completely stop the player from walking into walls, but this is what i have so far.

Public Class mymap
'movement function/class/etc?
Private Sub mymap_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
Dim Loc As Point

[code].....

is there a way to put a sub in a sub? see notes in the code above and hopefully you'll see what i mean.d last of the craziness, are global variables possible? i can't seem to find a tut on them. in the passable sub it doesn't recognize the tiles variable and says it isn't declared, though it is declared in the hedge1 sub.

View 4 Replies

2D Platform Game Physics - Game Development | Dream.In.Code?

Mar 11, 2010

I'm trying to make a 2D platform game and I'm pretty inexperienced at programming. I've coded the player to move left and right and jump, but I can't figure out how to prevent multiple jumps while the player is in the air. Anyone know how to do this?

View 8 Replies

Game Programming :: Firing Multiple Projectiles?

Oct 31, 2009

firing is triggered by clicking the background of the form (its a 2d space shooter, like asteroids)now the problem is, that when i click, it fires all 3 projectiles at the same time. and thats not good since its not very useful. so how do i have some sort of delay or something so it only fires one projectile every time i click

Code:
Private Sub background1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles background1.Click

[code]...

im doing this for a school project, and ive never done any programming before so please if you know how to make this work, can you explain it as well as possible.

View 5 Replies

Game Programming :: Rendering Of Multiple Sprites (2D Processing)?

Jul 29, 2010

I am embarking in the wonderous world of 2D animation and using directx9. I am a complete noob in the world of game engine design etc. I find DX quite usefull and in fact easy to use but in my opinion it's the engine design that makes or breaks the application. There are a massive amount of tutorials on the web explaning how to render a single image to a target but not so much for rendering a lot of sprites.

View 3 Replies

Detect Collision For A Game In Program?

Aug 5, 2010

How to detect collision for a game in vb.net ( i using picturebox for every thing ).

View 1 Replies

C# - Game Engine/Platform To Use In Order To Write Once And Deploy Everywhere?

May 24, 2012

Basically, I want to design a strategy game, where most of the game will be spent in menu areas and making "decisions" (like a Tycoon style game), however, there will still be some graphics, and I would prefer 3D, but if not possible, can resort to 2D. The graphics aren't user controlled, but the moving objects will be the result of the "decisions" the players make.

I really just want to write it once, and have it run on the following Platforms:

Windows Desktop
iOS (iPhone, iPod, iPad)
Android Phones (not strictly required)

(any other platforms would just be a bonus, but at the absolute minimum, all i really want is Windows Desktop and iOS [iPhone, iPod, iPad]).

Now, I don't want to learn objective-c or any other languages which i may have no use for in the future, I really just want to be able to program in Visual Studio (VB.Net or C#, since I can convert from vb.net to c# I will just be writing it in vb.net).

Is it possible to write in vb.net/c# and deploy to all these platforms? I heard of MonoTouch, so i can convert from vb to c# but is this seemless or difficult to do? Do I have to learn and write in another language in order to make tweaks to make it work on the iPhone or Android? So, with MonoTouch, can I still use XNA or is there a different engine that I need to learn/use with Visual Studio?

Alternatively, if I cannot do this all in VB.NET or Visual Studio, what programming language and/or graphics engine should I learn in order to be able to write once and deploy everywhere that is relevant? (So, not fussed about Linux, Mac's or other less used OS's).

Right now, I haven't learnt XNA but am wondering if I should or need to, or if i should learn another engine & language. Basically, I don't really know what I need to learn/know in order to be able to write once and deploy on Windows Desktop, iOS (iDevice's) and maybe Android. So, my question really is, what do I need to learn in terms of both the programming language and game/graphics engine. Right now I know VB.NET and would prefer to use what I know, but if not possible, then am prepared to learn another language & engine combination to be able to achieve what I want, if this is what I need to do, I would like to know what language & engine I need to learn.

View 3 Replies

Game Programming :: Make A Game In VB In Which Character Can Move Around, Jump, And Kill Things?

Apr 2, 2008

im trying to make a game in visual basic in which your character can move around, jump, and kill things. I can get the picture box with the character to move and everything is fine. but i did run into one problem. when the character moves over a tree (or something) you can see the gray backround of the character as i made in paint. how do i make the backround of the picturebox transparent?

View 4 Replies

Game Programming :: Adding Score To Rock Paper Scissor Game?

Oct 3, 2011

Im new to VB. how do I get to add the score.my code is

[Code]...

View 6 Replies

Game Programming :: Prevent Users Typing In Random Letters In A Text Box-Scrabble Game?

May 4, 2011

I have created a scrabble game that generates random letters. For the user to type in a word using the random letters they have to type it in a text box.

I want my program to prevent users from typing in letters that are not provided in the text box and to allow them to type in the random letters that are provided.

View 4 Replies

Game Programming :: Spinning Reel - Fruit Machine Game For Windows Mobile Device

Feb 16, 2011

I'm trying to make a simple fruit machine game for windows mobile device.

I can create the game easily enough and flip through pictures in a picture box to display the correct symbol.. but what I'd like to do is do a proper spinning reel, but have no idea where to even start.

What I have is a list of images in an imagelist (or individual files) - what I'd like is them attached to each other and moving downwards, preferably as though it were going around a drum but just them moving would be a start.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved