11 Replies - 605 Views - Last Post: 09 September 2011 - 07:29 AM Rate Topic: -----

#1 HxC_Pokecore  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 07-September 11

Simple Map Array

Posted 07 September 2011 - 05:29 PM

Okay guys, I'm making my first game, and I'm using Real Studio 2011r3.
It's just a simple game that's a small maze from a bird's eye view and you've got to dodge enemies and what not.
But I've been told to make a map array like this:

   
Select Case 0
  case 0

    //Column 0
    level1map(0,0) = 1
    level1map(0,1) = 1
    level1map(0,2) = 1
    level1map(0,3) = 1
    level1map(0,4) = 1
    level1map(0,5) = 1
    level1map(0,6) = 1
    level1map(0,7) = 1
    level1map(0,8) = 1
    level1map(0,9) = 1
    level1map(0,10) = 1
    level1map(0,11) = 1
    level1map(0,12) = 1
    level1map(0,13) = 1
    
    //Column 1
    level1map(1,0) = 1
    level1map(1,1) = 0
    level1map(1,2) = 0
    level1map(1,3) = 0
    level1map(1,4) = 0
    level1map(1,5) = 0
    level1map(1,6) = 0
    level1map(1,7) = 0
    level1map(1,8) = 0
    level1map(1,9) = 0
    level1map(1,10) = 0
    level1map(1,11) = 0
    level1map(1,12) = 1
    level1map(1,13) = 1
    
    //Column 2
    level1map(2,0) = 1
    level1map(2,1) = 0
    level1map(2,2) = 0
    level1map(2,3) = 0
    level1map(2,4) = 0
    level1map(2,5) = 0
    level1map(2,6) = 0
    level1map(2,7) = 0
    level1map(2,8) = 0
    level1map(2,9) = 0
    level1map(2,10) = 0
    level1map(2,11) = 0
    level1map(2,12) = 1
    level1map(2,13) = 1
    
    
    //Column 3
    level1map(3,0) = 1
    level1map(3,1) = 0
    level1map(3,2) = 0
    level1map(3,3) = 0
    level1map(3,4) = 0
    level1map(3,5) = 1
    level1map(3,6) = 1
    level1map(3,7) = 1
    level1map(3,8) = 0
    level1map(3,9) = 0
    level1map(3,10) = 0
    level1map(3,11) = 0
    level1map(3,12) = 0
    level1map(3,13) = 1
    
    
    //Column 4
    level1map(4,0) = 1
    level1map(4,1) = 0
    level1map(4,2) = 0
    level1map(4,3) = 0
    level1map(4,4) = 0
    level1map(4,5) = 0
    level1map(4,6) = 0
    level1map(4,7) = 0
    level1map(4,8) = 0
    level1map(4,9) = 0
    level1map(4,10) = 0
    level1map(4,11) = 0
    level1map(4,12) = 0
    level1map(4,13) = 1
    
    
    //Column 5
    level1map(5,0) = 1
    level1map(5,1) = 0
    level1map(5,2) = 0
    level1map(5,3) = 0
    level1map(5,4) = 0
    level1map(5,5) = 0
    level1map(5,6) = 0
    level1map(5,7) = 0
    level1map(5,8) = 0
    level1map(5,9) = 0
    level1map(5,10) = 0
    level1map(5,11) = 0
    level1map(5,12) = 0
    level1map(5,13) = 1
    
    //Column 6
    level1map(6,0) = 1
    level1map(6,1) = 0
    level1map(6,2) = 0
    level1map(6,3) = 0
    level1map(6,4) = 0
    level1map(6,5) = 0
    level1map(6,6) = 0
    level1map(6,7) = 0
    level1map(6,8) = 0
    level1map(6,9) = 0
    level1map(6,10) = 0
    level1map(6,11) = 0
    level1map(6,12) = 0
    level1map(6,13) = 1
    
    
    //Column 7
    level1map(7,0) = 1
    level1map(7,1) = 0
    level1map(7,2) = 0
    level1map(7,3) = 0
    level1map(7,4) = 0
    level1map(7,5) = 0
    level1map(7,6) = 0
    level1map(7,7) = 0
    level1map(7,8) = 0
    level1map(7,9) = 0
    level1map(7,10) = 0
    level1map(7,11) = 0
    level1map(7,12) = 0
    level1map(7,13) = 1
    
    
    //Column 8
    level1map(8,0) = 1
    level1map(8,1) = 0
    level1map(8,2) = 0
    level1map(8,3) = 0
    level1map(8,4) = 0
    level1map(8,5) = 0
    level1map(8,6) = 0
    level1map(8,7) = 0
    level1map(8,8) = 0
    level1map(8,9) = 0
    level1map(8,10) = 0
    level1map(8,11) = 0
    level1map(8,12) = 0
    level1map(8,13) = 1
    
    
    //Column 9
    level1map(9,0) = 1
    level1map(9,1) = 0
    level1map(9,2) = 0
    level1map(9,3) = 0
    level1map(9,4) = 0
    level1map(9,5) = 0
    level1map(9,6) = 0
    level1map(9,7) = 0
    level1map(9,8) = 0
    level1map(9,9) = 0
    level1map(9,10) = 0
    level1map(9,11) = 0
    level1map(9,12) = 0
    level1map(9,13) = 1
    
    
    //Column 10
    level1map(10,0) = 1
    level1map(10,1) = 0
    level1map(10,2) = 0
    level1map(10,3) = 0
    level1map(10,4) = 0
    level1map(10,5) = 0
    level1map(10,6) = 0
    level1map(10,7) = 0
    level1map(10,8) = 0
    level1map(10,9) = 0
    level1map(10,10) = 0
    level1map(10,11) = 0
    level1map(10,12) = 0
    level1map(10,13) = 1
    
    
    //Column 11
    level1map(11,0) = 1
    level1map(11,1) = 0
    level1map(11,2) = 0
    level1map(11,3) = 0
    level1map(11,4) = 0
    level1map(11,5) = 0
    level1map(11,6) = 0
    level1map(11,7) = 0
    level1map(11,8) = 0
    level1map(11,9) = 0
    level1map(11,10) = 0
    level1map(11,11) = 0
    level1map(11,12) = 0
    level1map(11,13) = 1
    
    
    //Column 12
    level1map(12,0) = 1
    level1map(12,1) = 0
    level1map(12,2) = 0
    level1map(12,3) = 0
    level1map(12,4) = 0
    level1map(12,5) = 0
    level1map(12,6) = 0
    level1map(12,7) = 0
    level1map(12,8) = 0
    level1map(12,9) = 0
    level1map(12,10) = 0
    level1map(12,11) = 0
    level1map(12,12) = 0
    level1map(12,13) = 1
    
    
    //Column 13
    level1map(13,0) = 1
    level1map(13,1) = 1
    level1map(13,2) = 1
    level1map(13,3) = 1
    level1map(13,4) = 1
    level1map(13,5) = 1
    level1map(13,6) = 1
    level1map(13,7) = 1
    level1map(13,8) = 1
    level1map(13,9) = 1
    level1map(13,10) = 1
    level1map(13,11) = 1
    level1map(13,12) = 1
    level1map(13,13) = 1
    
    
  end



Where = 0 means you can walk there, and = 1 means there is a wall.. pretty simple.
I've got level1map(13,13) as an integer, and the numbers in the brackets are supposed to be ypos, xpos..
The problem I'm having is..
Say I make level1map(5,7) as = 1, it'll make both the 5,7 and the 7,5 so that you can't walk into them.. even if 7,5 is still = 0.
I could have just left something out somewhere, but I've been trying to work this out for days..
Oh, and with the 7,5 will let me walk there if I walk from the left or right.. but not from the top or bottom.. :blink:
Thanks heaps to anyone who can help me :bigsmile:

Is This A Good Question/Topic? 0
  • +

Replies To: Simple Map Array

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9059
  • View blog
  • Posts: 34,017
  • Joined: 12-June 08

Re: Simple Map Array

Posted 07 September 2011 - 07:25 PM

Okay you need to explain this better.

What is Real Studio 2011r3? Is that even Visual Basic?

Second, why does making 5,7 one value automatically make 7,5 that value? Is that something you want or is that some jank side effect? Arrays normally do not act that way.
Was This Post Helpful? 0
  • +
  • -

#3 HxC_Pokecore  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 07-September 11

Re: Simple Map Array

Posted 07 September 2011 - 08:22 PM

Real Studio is Visual Basic, we have to use it at school on the Macs, so I've decided I may as well get used to it :) http://www.realsoftw...com/realstudio/
And the 5,7 7,5 side effect is the whole point of this question.. I don't know why it is doing it? D:
Was This Post Helpful? 0
  • +
  • -

#4 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: Simple Map Array

Posted 07 September 2011 - 08:52 PM

Real studio is not visual studio friend. :)

Similar syntax, cross platform, like java in that sense only I don't know how I can help you I'm sorry.

Ouch hlx! XD

This post has been edited by trevster344: 07 September 2011 - 09:01 PM

Was This Post Helpful? 0
  • +
  • -

#5 hlx  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 135
  • Joined: 13-November 10

Re: Simple Map Array

Posted 07 September 2011 - 08:55 PM

View Posttrevster344, on 07 September 2011 - 09:52 PM, said:

Real studio is not visual studio friend. :)



BLEH, my apologies, I meant to hit + and my touchpad went nuts.

Anyhow, REAL Studio likely uses REALBASIC, which is indeed not Visual Basic. They are close in syntax, but will also vary.
Was This Post Helpful? 0
  • +
  • -

#6 HxC_Pokecore  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 07-September 11

Re: Simple Map Array

Posted 07 September 2011 - 09:00 PM

Oh ok, I see..
Well, does anyone have any ideas on why it would be affecting both the y,x axis and the x,y axis when it should only be changing the y,x axis?
Thanks :bigsmile:

This post has been edited by HxC_Pokecore: 07 September 2011 - 09:00 PM

Was This Post Helpful? 0
  • +
  • -

#7 hlx  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 135
  • Joined: 13-November 10

Re: Simple Map Array

Posted 07 September 2011 - 09:05 PM

May we see your entire code? it sounds like syntax errors to me. (not checking properly on the x axis as opposed to the y axis, etc)
Was This Post Helpful? 0
  • +
  • -

#8 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: Simple Map Array

Posted 07 September 2011 - 09:05 PM

I'm confused, I've only ever been aware of an x axis, and a y axis or x,y. If you could explain the two axis's you speak of maybe I could help you out more.

As hlx said, do post all your code please. :)

On a side note I appreciate you introducing this real studio to me, I definitely love an environment similar to Visual Basic, but that's cross platform. That's a dream come true right there! Put my skills to use without wasting time.

This post has been edited by trevster344: 07 September 2011 - 09:13 PM

Was This Post Helpful? 0
  • +
  • -

#9 HxC_Pokecore  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 07-September 11

Re: Simple Map Array

Posted 07 September 2011 - 11:59 PM

No worries :)
Well, Real Studio is split up into different sections, rather than just one big bit of code.
I mean, my problem is I probably forgot to dim something, I dunno >.<

There's a few things that you'd need to know.. There isn't actually DIMing in Real Studio.. you define properties instead.
Anyway, I'll post it now.

Under "Event Handlers"

KeyDown
  
Select Case Asc(Key)
  Case 31 //up arrow
    moveup
    Canvas2.backdrop = sprite1
  Case 29 //Right arrow
    moveright
    Canvas2.backdrop = spriteright
  Case 30 //Down arrow
    movedown
    Canvas2.backdrop = spriteback
  Case 28 //Left arrow
    moveleft
    Canvas2.backdrop = spriteleft
  End Select
  

Open
  Select Case 0
    
  case 0
    
    
    //Column 0
    level1map(0,0) = 1
    level1map(0,1) = 1
    level1map(0,2) = 1
    level1map(0,3) = 1
    level1map(0,4) = 1
    level1map(0,5) = 1
    level1map(0,6) = 1
    level1map(0,7) = 1
    level1map(0,8) = 1
    level1map(0,9) = 1
    level1map(0,10) = 1
    level1map(0,11) = 1
    level1map(0,12) = 1
    level1map(0,13) = 1
    
    //Column 1
    level1map(1,0) = 1
    level1map(1,1) = 0
    level1map(1,2) = 0
    level1map(1,3) = 0
    level1map(1,4) = 0
    level1map(1,5) = 0
    level1map(1,6) = 0
    level1map(1,7) = 0
    level1map(1,8) = 0
    level1map(1,9) = 0
    level1map(1,10) = 0
    level1map(1,11) = 0
    level1map(1,12) = 0
    level1map(1,13) = 1
    
    //Column 2
    level1map(2,0) = 1
    level1map(2,1) = 0
    level1map(2,2) = 0
    level1map(2,3) = 0
    level1map(2,4) = 0
    level1map(2,5) = 0
    level1map(2,6) = 0
    level1map(2,7) = 0
    level1map(2,8) = 0
    level1map(2,9) = 0
    level1map(2,10) = 0
    level1map(2,11) = 0
    level1map(2,12) = 0
    level1map(2,13) = 1
    
    
    //Column 3
    level1map(3,0) = 1
    level1map(3,1) = 0
    level1map(3,2) = 0
    level1map(3,3) = 0
    level1map(3,4) = 0
    level1map(3,5) = 1
    level1map(3,6) = 1
    level1map(3,7) = 1
    level1map(3,8) = 0
    level1map(3,9) = 0
    level1map(3,10) = 0
    level1map(3,11) = 0
    level1map(3,12) = 0
    level1map(3,13) = 1
    
    
    //Column 4
    level1map(4,0) = 1
    level1map(4,1) = 0
    level1map(4,2) = 0
    level1map(4,3) = 0
    level1map(4,4) = 0
    level1map(4,5) = 0
    level1map(4,6) = 0
    level1map(4,7) = 0
    level1map(4,8) = 0
    level1map(4,9) = 0
    level1map(4,10) = 0
    level1map(4,11) = 0
    level1map(4,12) = 0
    level1map(4,13) = 1
    
    
    //Column 5
    level1map(5,0) = 1
    level1map(5,1) = 0
    level1map(5,2) = 0
    level1map(5,3) = 0
    level1map(5,4) = 0
    level1map(5,5) = 0
    level1map(5,6) = 0
    level1map(5,7) = 0
    level1map(5,8) = 0
    level1map(5,9) = 0
    level1map(5,10) = 0
    level1map(5,11) = 0
    level1map(5,12) = 0
    level1map(5,13) = 1
    
    //Column 6
    level1map(6,0) = 1
    level1map(6,1) = 0
    level1map(6,2) = 0
    level1map(6,3) = 0
    level1map(6,4) = 0
    level1map(6,5) = 0
    level1map(6,6) = 0
    level1map(6,7) = 0
    level1map(6,8) = 0
    level1map(6,9) = 0
    level1map(6,10) = 0
    level1map(6,11) = 0
    level1map(6,12) = 0
    level1map(6,13) = 1
    
    
    //Column 7
    level1map(7,0) = 1
    level1map(7,1) = 0
    level1map(7,2) = 0
    level1map(7,3) = 0
    level1map(7,4) = 0
    level1map(7,5) = 0
    level1map(7,6) = 0
    level1map(7,7) = 0
    level1map(7,8) = 0
    level1map(7,9) = 0
    level1map(7,10) = 0
    level1map(7,11) = 0
    level1map(7,12) = 0
    level1map(7,13) = 1
    
    
    //Column 8
    level1map(8,0) = 1
    level1map(8,1) = 0
    level1map(8,2) = 0
    level1map(8,3) = 0
    level1map(8,4) = 0
    level1map(8,5) = 0
    level1map(8,6) = 0
    level1map(8,7) = 0
    level1map(8,8) = 0
    level1map(8,9) = 0
    level1map(8,10) = 0
    level1map(8,11) = 0
    level1map(8,12) = 0
    level1map(8,13) = 1
    
    
    //Column 9
    level1map(9,0) = 1
    level1map(9,1) = 0
    level1map(9,2) = 0
    level1map(9,3) = 0
    level1map(9,4) = 0
    level1map(9,5) = 0
    level1map(9,6) = 0
    level1map(9,7) = 0
    level1map(9,8) = 0
    level1map(9,9) = 0
    level1map(9,10) = 0
    level1map(9,11) = 0
    level1map(9,12) = 0
    level1map(9,13) = 1
    
    
    //Column 10
    level1map(10,0) = 1
    level1map(10,1) = 0
    level1map(10,2) = 0
    level1map(10,3) = 0
    level1map(10,4) = 0
    level1map(10,5) = 0
    level1map(10,6) = 0
    level1map(10,7) = 0
    level1map(10,8) = 0
    level1map(10,9) = 0
    level1map(10,10) = 0
    level1map(10,11) = 0
    level1map(10,12) = 0
    level1map(10,13) = 1
    
    
    //Column 11
    level1map(11,0) = 1
    level1map(11,1) = 0
    level1map(11,2) = 0
    level1map(11,3) = 0
    level1map(11,4) = 0
    level1map(11,5) = 0
    level1map(11,6) = 0
    level1map(11,7) = 0
    level1map(11,8) = 0
    level1map(11,9) = 0
    level1map(11,10) = 0
    level1map(11,11) = 0
    level1map(11,12) = 0
    level1map(11,13) = 1
    
    
    //Column 12
    level1map(12,0) = 1
    level1map(12,1) = 0
    level1map(12,2) = 0
    level1map(12,3) = 0
    level1map(12,4) = 0
    level1map(12,5) = 0
    level1map(12,6) = 0
    level1map(12,7) = 0
    level1map(12,8) = 0
    level1map(12,9) = 0
    level1map(12,10) = 0
    level1map(12,11) = 0
    level1map(12,12) = 0
    level1map(12,13) = 1
    
    
    //Column 13
    level1map(13,0) = 1
    level1map(13,1) = 1
    level1map(13,2) = 1
    level1map(13,3) = 1
    level1map(13,4) = 1
    level1map(13,5) = 1
    level1map(13,6) = 1
    level1map(13,7) = 1
    level1map(13,8) = 1
    level1map(13,9) = 1
    level1map(13,10) = 1
    level1map(13,11) = 1
    level1map(13,12) = 1
    level1map(13,13) = 1
    
  end




Under "Methods"
Movedown
  if level1map((playery - 1),Playerx) > 0 then
  else
    
    canvas2.top = canvas2.top - 64
    playery = playery - 1
    
  end 


Moveleft
  if level1map((playerx - 1),Playery) > 0 then
  else
    
    canvas2.left = canvas2.left - 64
    playerx = playerx - 1
    
  end


Moveright
  if level1map((playerx + 1),Playery) > 0 then
  else
    
    canvas2.left = canvas2.left + 64
    playerx = playerx + 1
    
  end


Moveup
  if level1map((playery + 1),Playerx) > 0 then
  else
    
    canvas2.top = canvas2.top + 64
    playery = playery + 1
    
  end


Under "Properties"
level1map(13,13) as Integer
playerx as Integer = 2 (because my player is starting at the second square across)
playery as Integer = 1
xpos as Integer = 1
ypos as Integer = 1


So that's all of it, and I understand this is probably a bit hard to understand because it's an unfamiliar program to both of you, but I don't think it's too hard to get? :)
Thanks heaps to both of you, and to anyone else if they help :bigsmile:

Oh, and I also attached a picture with the left sidebar so you can see how it's laid out :)

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#10 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: Simple Map Array

Posted 08 September 2011 - 09:32 PM

There's still diming or declaring it looks like, but it's just not as blatant as we are accustomed. :) Looks quite interesting. I wish I could figure it out, but this is an anomaly to me lol. I can't spot how your x, y coordinates would be affected as you describe. Maybe a fresh look another day will work, but I hope you figure it out friend. Sorry I couldn't be of more help. :)
Was This Post Helpful? 1
  • +
  • -

#11 HxC_Pokecore  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 07-September 11

Re: Simple Map Array

Posted 08 September 2011 - 11:43 PM

I asked the whole of the year 11 class (2 years up from me) if they knew how to fix it (they're doing the same thing) and they didn't know how. None of them had this problem.. :/
I'll keep playing, and I'll try getting one of their project files and seeing where it's different..
Thankyou both for your help :)
Was This Post Helpful? 0
  • +
  • -

#12 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: Simple Map Array

Posted 09 September 2011 - 07:29 AM

Hahaha I don't consider myself an intermediate programmer, or expert programmer in any way, but I figured they wouldn't be able to figure it out either. ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1