Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help needed
#1
say i made a character whom has 0 stats and he faced a slime the slime had 50 hp and he dealt only 2 hits how do i put that on the code im very new to GW_BASIC
Reply
#2
(05-01-2024, 01:32 PM)BloodyHash Wrote: say i made a character whom has 0 stats and he faced a slime the slime had 50 hp and he dealt only 2 hits how do i put that on the code im very new to GW_BASIC

welcome to forum @bloodyhash

though this is not a gw basic forum if you are new to basic you might use it to get started but gw forces you to use line numbers and all that is unneceassary when you move to higher QB's specially QB64pe used at this forum.

to get help you have to remember we cant read your mind and know wth you are talking about; stats is what kind of data structure? what properties do you have setup for charater, hero? = player/user controlled?, slime? 50 hp ??? hp = hit points or what?

this HI (human intelligence) needs more information, to be of help Smile perhaps some code posted of what you tried and better description of result you looking to accomplish....
b = b + ...
Reply
#3
(05-01-2024, 01:32 PM)BloodyHash Wrote: say i made a character whom has 0 stats and he faced a slime the slime had 50 hp and he dealt only 2 hits how do i put that on the code im very new to GW_BASIC
This is a very quick demo of how I would approach this.

Code: (Select All)


TYPE WEAPON '              define weapons
    Name AS STRING '      name of weapon
    HitDamage AS INTEGER ' damage weapon inflicts
END TYPE

TYPE CHARACTER '          define characters
    HitPoints AS INTEGER ' hit points remaining
    Weapon AS WEAPON '    weapon character yielding
END TYPE

DIM Player AS CHARACTER '  create a player
DIM Slime AS CHARACTER '  create an enemy
DIM Axe AS WEAPON '        create a player weapon
DIM Spit AS WEAPON '      create an enemy weapon
DIM KeyPress AS STRING '  any keyboard key press
DIM Enter AS STRING '      the ENTER key
DIM ESC AS STRING '        the ESC key

Enter = CHR$(13) '        define the ENTER key
ESC = CHR$(27) '          define the ESC key

Axe.Name = "Axe" '        give player weapon a name
Axe.HitDamage = 2 '        damage weapon posseses

Spit.Name = "Acid Spit" '  give enemy weapon a name
Spit.HitDamage = 10 '      damage weapon posses

Player.HitPoints = 50 '    set amount of HP player currently has
Player.Weapon = Axe '      give player a weapon

Slime.HitPoints = 50 '    set amount of HP Slime currently has
Slime.Weapon = Spit '      give Slime a weapon

DO
    PRINT "The Slime currently has"; Slime.HitPoints; "hit points remaining."
    PRINT
    PRINT "Press ENTER to attack with your "; Player.Weapon.Name;"!"
    PRINT
    DO '                                                          begin keyboard input loop
        _LIMIT 10 '                                                check 10 times per second
        KeyPress = INKEY$ '                                        get any key press
    LOOP UNTIL KeyPress = Enter OR KeyPress = ESC '                leave when ENTER or ESC
    Slime.HitPoints = Slime.HitPoints - Player.Weapon.HitDamage '  inflict damage on slime
    PRINT "Your "; Player.Weapon.Name; " finds it mark! The Slime oozes in pain!"
    PRINT
LOOP UNTIL _KEYDOWN(27) '                                          press ESC to end
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#4
That really helped me thanks Big Grin Heart
Reply
#5
By the way @BloodyHash there is a game writing tutorial available here that will help you get started:

QB64 Game Tutorial
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#6
(05-01-2024, 02:17 PM)bplus Wrote:
(05-01-2024, 01:32 PM)BloodyHash Wrote: say i made a character whom has 0 stats and he faced a slime the slime had 50 hp and he dealt only 2 hits how do i put that on the code im very new to GW_BASIC

welcome to forum @bloodyhash

though this is not a gw basic forum if you are new to basic you might use it to get started but gw forces you to use line numbers and all that is unneceassary when you move to higher QB's specially QB64pe used at this forum.

to get help you have to remember we cant read your mind and know wth you are talking about; stats is what kind of data structure? what properties do you have setup for charater, hero? = player/user controlled?, slime? 50 hp ??? hp = hit points or what?

this HI (human intelligence) needs more information, to be of help Smile perhaps some code posted of what you tried and better description of result you looking to accomplish....

thanks for the welcome

(05-01-2024, 04:13 PM)TerryRitchie Wrote: By the way @BloodyHash there is a game writing tutorial available here that will help you get started:

QB64 Game Tutorial

wooooooooo thanks man today i learn tomorrow i code next day i'll be making games Big GrinD
Reply
#7
(05-01-2024, 04:15 PM)BloodyHash Wrote:
(05-01-2024, 02:17 PM)bplus Wrote:
(05-01-2024, 01:32 PM)BloodyHash Wrote: say i made a character whom has 0 stats and he faced a slime the slime had 50 hp and he dealt only 2 hits how do i put that on the code im very new to GW_BASIC

welcome to forum @bloodyhash

though this is not a gw basic forum if you are new to basic you might use it to get started but gw forces you to use line numbers and all that is unneceassary when you move to higher QB's specially QB64pe used at this forum.

to get help you have to remember we cant read your mind and know wth you are talking about; stats is what kind of data structure? what properties do you have setup for charater, hero? = player/user controlled?, slime? 50 hp ??? hp = hit points or what?

this HI (human intelligence) needs more information, to be of help Smile perhaps some code posted of what you tried and better description of result you looking to accomplish....

thanks for the welcome

(05-01-2024, 04:13 PM)TerryRitchie Wrote: By the way @BloodyHash there is a game writing tutorial available here that will help you get started:

QB64 Game Tutorial

wooooooooo thanks man today i learn tomorrow i code next day i'll be making games Big GrinD
LOL, I wish it were that easy Cool 

Just take your time and go through the tutorial one step at a time. I wrote it so beginner's such as yourself are taken from the very basic to the more advanced as you go through the lessons.

You'll get there though!
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#8
(05-01-2024, 04:17 PM)TerryRitchie Wrote:
(05-01-2024, 04:15 PM)BloodyHash Wrote:
(05-01-2024, 02:17 PM)bplus Wrote: welcome to forum @bloodyhash

though this is not a gw basic forum if you are new to basic you might use it to get started but gw forces you to use line numbers and all that is unneceassary when you move to higher QB's specially QB64pe used at this forum.

to get help you have to remember we cant read your mind and know wth you are talking about; stats is what kind of data structure? what properties do you have setup for charater, hero? = player/user controlled?, slime? 50 hp ??? hp = hit points or what?

this HI (human intelligence) needs more information, to be of help Smile perhaps some code posted of what you tried and better description of result you looking to accomplish....

thanks for the welcome

(05-01-2024, 04:13 PM)TerryRitchie Wrote: By the way @BloodyHash there is a game writing tutorial available here that will help you get started:

QB64 Game Tutorial

wooooooooo thanks man today i learn tomorrow i code next day i'll be making games Big GrinD
LOL, I wish it were that easy Cool 

Just take your time and go through the tutorial one step at a time. I wrote it so beginner's such as yourself are taken from the very basic to the more advanced as you go through the lessons.

You'll get there though!
i'll make you proud sensei!
Reply
#9
well theres a motivated person Smile
b = b + ...
Reply
#10
(05-01-2024, 06:00 PM)bplus Wrote: well theres a motivated person Smile

I know right ... excellent!
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply




Users browsing this thread: 2 Guest(s)