QB64 Phoenix Edition
help needed - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: help needed (/showthread.php?tid=2642)



help needed - BloodyHash - 05-01-2024

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


RE: help needed - bplus - 05-01-2024

(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....


RE: help needed - TerryRitchie - 05-01-2024

(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



RE: help needed - BloodyHash - 05-01-2024

That really helped me thanks Big Grin Heart


RE: help needed - TerryRitchie - 05-01-2024

By the way @BloodyHash there is a game writing tutorial available here that will help you get started:

QB64 Game Tutorial


RE: help needed - BloodyHash - 05-01-2024

(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


RE: help needed - TerryRitchie - 05-01-2024

(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!


RE: help needed - BloodyHash - 05-01-2024

(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!


RE: help needed - bplus - 05-01-2024

well theres a motivated person Smile


RE: help needed - TerryRitchie - 05-01-2024

(05-01-2024, 06:00 PM)bplus Wrote: well theres a motivated person Smile

I know right ... excellent!