Latest Uploads
Extraterre ... .0.1 (zip)

dantheman363

Monty Teas ... Screenie 1

steve_ancell

Santa Clau ... ed his bag

waroffice

manic_platdude.png

spinal

Tetris Clone

steve_ancell

Super blues bros.

spinal

Forum Home

help with a code please

UserMessage
Posted : Friday, 11 May 2012, 15:14 | Permalink | Mark Here
daniel11111112


simple tilemap and character script this is the game i was working on could someone help me with a problem that came up while i was testing if i move to the edge of the map the map stops moveing but the character keeps going as its meant to but if i try to move away from the edge the character stays in the same place on the screen (youll see what i mean when you test it)
Posted : Friday, 11 May 2012, 18:22 | Permalink | Mark Here
steve_ancell


I'm getting a Memory Access Violation (MAV) when I run it, in debug mode it shows an Array Index Out Of Bounds. Don't know if you already knew this arrays in Blitz3D start at zero.

I will have a look at the code and see what I can do.
Posted : Friday, 11 May 2012, 18:30 | Permalink | Mark Here
steve_ancell


Another tip:

Just above where your Data commands start, give it a name so that you can use the Restore command to select each level you make for, to name a Data block you would use a decimal point followed by a name, for example...

.Map1
Data 12345
And any other lines of Data commands that go in this level.

.Map2
And all the Data commands that make that level.
Posted : Friday, 11 May 2012, 20:10 | Permalink | Mark Here
steve_ancell


Actually, it may be easier if I just pop over at the weekend and go through a few things with you.
Posted : Friday, 11 May 2012, 20:45 | Permalink | Mark Here
steve_ancell


Right!, I've managed to get the code running without MAVing out, I can now see what is happening and I will rip it apart tomorrow.
Posted : Friday, 11 May 2012, 20:48 | Permalink | Mark Here
steve_ancell


You also forgot to include graphics for the character so I modified it to work temporarily without that particular sprite.

-->
Posted : Saturday, 12 May 2012, 07:46 | Permalink | Mark Here
daniel11111112


ok :3 sorry for the late response i just got back onto socoder i was playing with my freinds online yesterday also everything works my end i dunno whats wrong... did you add the pictures into the same place as the code?
Posted : Sunday, 13 May 2012, 07:07 | Permalink | Mark Here
Afr0


WW Entries : 3
First of all:
This isn't a "script". This is a "program". A "script" is external code run by a program. Now, interpreted languages like C# and Java are run by a VM (Virtual Machine), but C# is JIT-compiled (Just In Time) when a program is run for the first time, meaning that C# is less of a scripting language than Java.

Secondly:
Don't use the Data command. At least not if you intend to make this in to a game. The Data command increases the size of your executable unnecessarily and makes your code longer than it has to be. Not to mention the fact that it requires you to recompile your program every time you update a tile-map. And the Blitz compiler is slow as-is, so if you have a million lines of code, that's not what you want to be doing.
Learn about file IO! The only argument I could see for using the Data command would be that it makes it harder to tamper with your tile-maps, but if you want to achieve that, you should learn about encryption instead. Or simply design a custom binary format used by your application that can hold many tile-maps at once. Heck, it doesn't even have to be very complicated. The Sims and The Sims Online uses FAR (File ARchive), which is basically a textbook example of an archiving format that doesn't use encryption or compression.
The specs are here, you should be able to riff on that quite easily if you've learned about file IO.

-----
Afr0 Games

Project Dollhouse on Github - Please fork!
Posted : Sunday, 13 May 2012, 10:40 | Permalink | Mark Here
steve_ancell


I'm going to give Daniel a crash course on file I/O when I visit next.

|edit| I also showed him what labels can be useful for when I was over there yesterday. |edit|
Latest Posts
Sidewalk Skiing
Jayenkai Sat 14:57
Musical Tastes
Dabz Sat 11:38
FIRST!!!
steve_ancell Sat 11:22
Coder's Block
Jayenkai Thu 09:01
Consumer Lockout
9572AD Thu 06:09
Professor Oak, Honest!!
spinal Wed 23:24
Position in Mind
steve_ancell Wed 20:11
Sonic Adventure v0.x
Jayenkai Wed 07:08
Noel's Graduation
waroffice Wed 02:55
Monkey vs iOS tweaks
spinal Tue 22:51
More

Latest Items
News : Newsletter #176
Jayenkai Sat 04:49
News : Newsletter #175
Dabz Tue 09:38
Blog : Snow: More Material Junk
Cower Sat 23:17
Dev-Diary : Mutant Monty: Amstrad CPC to Windows conversion
rockford Fri 13:14
Techy : AppleTV
Jayenkai Thu 09:40
Blog : Graphviz
steve_ancell Sat 14:17
Pets : Top-Down Shadow Hack
Jayenkai Tue 05:52
Snippet : JNKrunch v1.0
Jayenkai Sat 07:20
News : Newsletter #173
waroffice Fri 04:47
Blog : Material Loading
Cower Fri 02:08
Pets : I Done Won A Thing
shroom_monk Sun 11:31
Pets : Repurposing A Lexer
Cower Mon 22:06
Bah : Feeling a Little Angry
spinal Mon 11:26
News : Newsletter #170
Dabz Sat 00:34
Showcase : sbfgen
Cower Sat 16:57
More

Who's Online
9572AD
Sat, at 19:18
Evil Roy Ferguson
Sat, at 19:12
therevillsgames
Sat, at 19:08
steve_ancell
Sat, at 18:47
CodersRule
Sat, at 18:37
dna
Sat, at 18:05
Cower
Sat, at 17:39
Jayenkai
Sat, at 16:33
shroom_monk
Sat, at 16:29
HoboBen
Sat, at 16:15
Link to this page
Site : Jayenkai 2006-Infinity |
MudChat's origins, BBCode's former life, Image Scaler.