Qbasicnews.com
April 05, 2020, 12:54:44 AM
 Pages: [1]
 Author Topic: Charakter  (Read 2562 times)
Weasel88
Member

Posts: 41

 « on: August 10, 2003, 08:27:16 PM »

I have read darkdreads RPG-tutorial on how to make an map and a character who the player can move with the arrow keys.... now i want to change the charakter and i dont just want to use circles( i want lines also) but when i try the game get screwed so can someone explain to me how to change it and NOT screw the game

this is the code for the charakter:

Code:

X% = PlayerX% * 20                  ' This little routine draws our
Y% = PlayerY% * 20                  ' character in the right position
CIRCLE (X% + 9, Y% + 9), 9, 40      ' on the screen.
PAINT (X% + 9, Y% + 9), 40, 40
CIRCLE (X% + 5, Y% + 6), 3, 31
PAINT (X% + 5, Y% + 6), 31, 31
CIRCLE (X% + 13, Y% + 6), 3, 31
PAINT (X% + 13, Y% + 6), 31, 31
CIRCLE (X% + 5, Y% + 6), 0, 16
CIRCLE (X% + 13, Y% + 6), 0, 16
CIRCLE (X% + 4, Y% + 17), 2, 4
PAINT (X% + 4, Y% + 17), 4, 4
CIRCLE (X% + 14, Y% + 17), 2, 4
PAINT (X% + 14, Y% + 17), 4, 4
CIRCLE (X% + 9, Y% + 9), 2, 16
PAINT (X% + 9, Y% + 9), 16, 16

 Logged
oracle
*/-\*

Posts: 3652

 « Reply #1 on: August 11, 2003, 12:23:40 AM »

Without fully understanding how your game is getting screwed I'll have to guess, so try reading this and copying the code etc: http://faq.qbasicnews.com/?blast=DoubleBufferingConcepts
 Logged

barok
Na_th_an

Posts: 1727

 « Reply #2 on: August 11, 2003, 02:05:51 AM »

just to make things more complicated, here's another tut on double buffering (i like it very much)

www.rpg-dev.net/buffering.txt
 Logged

Jumping Jahoolipers!
Weasel88
Member

Posts: 41

 « Reply #3 on: August 11, 2003, 08:20:43 AM »

well this is the prolem...

if i change the first circle(CIRCLE (X% + 9, Y% + 9), 9, 40 )
to: LINE (X% + 9, Y% + 9)-(X% + 9, Y% + 9), 9, BF
then you only can see the charakters eyes and everything is red
and when i move u can see the part of the map where the charakter is but if you move 2 or 3 steps more everything gets
red again... that is the prolem
 Logged
whitetiger0990
__/--\__

Posts: 2964

 « Reply #4 on: August 11, 2003, 09:21:40 AM »

is there a paint command?
 Logged

[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
na_th_an
*/-\*

Posts: 8244

 « Reply #5 on: August 11, 2003, 10:31:30 AM »

Check paint's last parameter. It specifies which colour will be the limit. It will surpass any other colour. That's your problem.
 Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
whitetiger0990
__/--\__

Posts: 2964

 « Reply #6 on: August 11, 2003, 02:53:45 PM »

im makinbg program that you fly a helicopter around and it is red with a blueish windshield and when i used paint to paint it red it went right over the windshield
 Logged

[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
oracle
*/-\*

Posts: 3652

 « Reply #7 on: August 11, 2003, 07:37:15 PM »

Because the border colour for the body (I presume you are painting the body red, not the windshield) is not one colour. There will be a hole and so paint keeps filling past it. That's why I don't like and hardly ever use PAINT. It's better to make the actual image and PUT it to the screen (with the lovely WAIT &H3DA command to eliminate flicker).
 Logged

whitetiger0990
__/--\__

Posts: 2964

 « Reply #8 on: August 11, 2003, 07:38:22 PM »

Quote from: "oracle"
Because the border colour for the body (I presume you are painting the body red, not the windshield) is not one colour. There will be a hole and so paint keeps filling past it. That's why I don't like and hardly ever use PAINT. It's better to make the actual image and PUT it to the screen (with the lovely WAIT &H3DA command to eliminate flicker).

That what happened to  my windshield
 Logged

[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
oracle
*/-\*

Posts: 3652

 « Reply #9 on: August 11, 2003, 07:41:52 PM »

Eh? What do you mean?
 Logged

Weasel88
Member

Posts: 41

 « Reply #10 on: August 11, 2003, 09:05:49 PM »

ok thanks for the answears.... i have an another question... erm... what is buffering for?  :oops:
 Logged
whitetiger0990
__/--\__

Posts: 2964

 « Reply #11 on: August 11, 2003, 09:42:32 PM »

Quote from: "oracle"
Eh? What do you mean?
IT painted ast my windshield
 Logged

[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
na_th_an
*/-\*

Posts: 8244

 « Reply #12 on: August 11, 2003, 10:36:55 PM »

In the tutorial that barok's has provided, as well as mine, it explains why you do want a double buffer.

The explanation is simple: using double buffering, you draw to a piece of memory instead to screen. Then, you draw the whole buffer (that piece of memory) to screen, so graphics aren't seen until they are fully drawn. When you do animations, you constatly erase stuff and draw it somewhere else. If you don't double buffer your animation, it will flicker, as the player will see how stuff is deleted and then repainted. If you do this outside the screen, the erasing/repainting process is kept hiden and the user just sees the finished image just after the next, thus obtaining an illusion of movement.
 Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
 Pages: [1]