Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How do you make things move in VB?

NewprogNewprog Posts: 3Member
I am designing a 2D game like those internet ones (NightMist, Realms of Kaos etc) and I cannot move from one picture to another! Ive tried everything i know of: multi-dimensional arrays, loops, even making a separate TextBox for each "room", piling them together and then enabling them in order. Nothing of that worked. Does anyone know how to make ImageX go from picture A to B to C using TextBox1 and maybe an "Enter" button. Please help, I know this sounds like a newbie question but its stopping me from moving on to other aspects of the program. Thank you.

Comments

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    : I am designing a 2D game like those internet ones (NightMist, Realms of Kaos etc) and I cannot move from one picture to another! Ive tried everything i know of: multi-dimensional arrays, loops, even making a separate TextBox for each "room", piling them together and then enabling them in order. Nothing of that worked. Does anyone know how to make ImageX go from picture A to B to C using TextBox1 and maybe an "Enter" button. Please help, I know this sounds like a newbie question but its stopping me from moving on to other aspects of the program. Thank you.
    :

    I need a bit more information on what you plan to do. Do you want the user to enter a certain text and then just load a new image? Do you want the game 3D, but only able to move between rooms without 3D controls? Give me some more info and I'll see what I can do.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • NewprogNewprog Posts: 3Member
    [b][red]This message was edited by Newprog at 2003-5-22 10:0:56[/red][/b][hr]
    : : I am designing a 2D game like those internet ones (NightMist, Realms of Kaos etc) and I cannot move from one picture to another! Ive tried everything i know of: multi-dimensional arrays, loops, even making a separate TextBox for each "room", piling them together and then enabling them in order. Nothing of that worked. Does anyone know how to make ImageX go from picture A to B to C using TextBox1 and maybe an "Enter" button. Please help, I know this sounds like a newbie question but its stopping me from moving on to other aspects of the program. Thank you.
    : :
    :
    : I need a bit more information on what you plan to do. Do you want the user to enter a certain text and then just load a new image? Do you want the game 3D, but only able to move between rooms without 3D controls? Give me some more info and I'll see what I can do.
    :
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    :
    : OK, i am designing a 2D game where if say you type "south" or "s" a picture of the room pops up. Then, i want to type "s" again and another picture pops up. But I cant! It just swiches to where I type "s" the second time. So, i guess i do want a new picture each time "s" is pressed. Help would really be appreciated, thank you



  • gautamgautam Posts: 642Member
    Hey,

    This looks simple. You should have a list of images in a buffer already and index to get the image attributes. I don't know how you do it in VB. I will try to give a simple example.

    I have lets say 4 images -> a, b, c, d.

    I have a structure like this
    struct abcd {
    vertex coordinates;
    image data
    } abcd;

    abcd x[4];

    so now I have index 0 to be a, 1 to be b, 2 to be c 3 to be d.

    Increment the index and update the data as and when 's' is pressed.

    Hope this answers your question.

    : [b][red]This message was edited by Newprog at 2003-5-22 10:0:56[/red][/b][hr]
    : : : I am designing a 2D game like those internet ones (NightMist, Realms of Kaos etc) and I cannot move from one picture to another! Ive tried everything i know of: multi-dimensional arrays, loops, even making a separate TextBox for each "room", piling them together and then enabling them in order. Nothing of that worked. Does anyone know how to make ImageX go from picture A to B to C using TextBox1 and maybe an "Enter" button. Please help, I know this sounds like a newbie question but its stopping me from moving on to other aspects of the program. Thank you.
    : : :
    : :
    : : I need a bit more information on what you plan to do. Do you want the user to enter a certain text and then just load a new image? Do you want the game 3D, but only able to move between rooms without 3D controls? Give me some more info and I'll see what I can do.
    : :
    : : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    : :
    : : OK, i am designing a 2D game where if say you type "south" or "s" a picture of the room pops up. Then, i want to type "s" again and another picture pops up. But I cant! It just swiches to where I type "s" the second time. So, i guess i do want a new picture each time "s" is pressed. Help would really be appreciated, thank you
    :
    :
    :
    :

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    : : : OK, i am designing a 2D game where if say you type "south" or "s" a picture of the room pops up. Then, i want to type "s" again and another picture pops up. But I cant! It just swiches to where I type "s" the second time. So, i guess i do want a new picture each time "s" is pressed. Help would really be appreciated, thank you

    Thatis super-simple! It's basically like a MUD, but graphical. That was how my first game was coded. Now, rather than loading all your images at once, try it like this.
    [code]
    typedef struct tagMAPDATA
    {
    char ImageFile[256];
    int SceneNumber;
    //Other data pertaining to your scene
    } MAPDATA;
    [/code]
    Now you simply reference the scenes by the "SceneNumber" variable. When the player goes into a new scene, it looks at that scene's "ImageFile" and loads it up. This way you only have one image loaded at a time, thus saving memory, and unless you're on a 286 or are some kind of android, you won't notice any loading time difference. I can go into further detail on making it work this way, such as how to tell each scene what exits to display to the player or how to tell it what baddies are in each scene. Let me know if you need any more help.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • NewprogNewprog Posts: 3Member
    : : : : OK, i am designing a 2D game where if say you type "south" or "s" a picture of the room pops up. Then, i want to type "s" again and another picture pops up. But I cant! It just swiches to where I type "s" the second time. So, i guess i do want a new picture each time "s" is pressed. Help would really be appreciated, thank you
    :
    : Thatis super-simple! It's basically like a MUD, but graphical. That was how my first game was coded. Now, rather than loading all your images at once, try it like this.
    : [code]
    : typedef struct tagMAPDATA
    : {
    : char ImageFile[256];
    : int SceneNumber;
    : //Other data pertaining to your scene
    : } MAPDATA;
    : [/code]
    : Now you simply reference the scenes by the "SceneNumber" variable. When the player goes into a new scene, it looks at that scene's "ImageFile" and loads it up. This way you only have one image loaded at a time, thus saving memory, and unless you're on a 286 or are some kind of android, you won't notice any loading time difference. I can go into further detail on making it work this way, such as how to tell each scene what exits to display to the player or how to tell it what baddies are in each scene. Let me know if you need any more help.
    :
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
    :
    : Um...ok. Btw i dont think ive made it a point just how much a newb i am. I dont know much about VB at all. Strings and arrays are currently my only strong point (um...strong) I would be very grateful if you could give me a mock program to try out on my VB package, just to see if it works. Or maybe its just that im working with VBA in Excel that some features are inaccessible...what package do i need to design a decent game: proffecional, enterprize, or is mine all right? Thank you

Sign In or Register to comment.