jump n run problem ** Gelößt **

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

 

oki02

Betreff: jump n run problem ** Gelößt **

BeitragMo, Aug 25, 2008 23:08
Antworten mit Zitat
Benutzer-Profile anzeigen
Mein Mensch soll auf dem Strich unten Stehen bleiben aber ich weiß nicht wie ich es programmieren soll?
Habe schon herumprobiert aber trotztem noch nichts erreicht.

Code: [AUSKLAPPEN]

Graphics 640,480,32,2
SetBuffer BackBuffer()

; Global's

Global xp# = 100
Global yp# = 200
Global yg# = 0

Global rechts   = 205
Global links    = 203
Global leer     = 57
Global jump_hohe = 0

; Hauptschleife

While Not KeyHit(1)

Mensch = LoadImage("Bilder\Mensch1.png")

DrawImage Mensch ,xp,yp

; Tastenabfragen

If KeyDown(rechts)   Then xp = xp + 10         ; Rechts
If KeyDown(links)    Then xp = xp - 10         ; Links
If KeyHit (57) Then yg=-6

If xp < 0     Then xp = 640
If xp > 640 Then xp = 0
If yp < 0     Then yp = 480
If yp > 480 Then yp = 0

yg=yg+0.1
yp=yp+yg

Line 5,475,635,475

Flip
Cls
Wend
End


mfg Oki02 Very Happy
  • Zuletzt bearbeitet von oki02 am Di, Aug 26, 2008 14:19, insgesamt 2-mal bearbeitet

SpionAtom

BeitragMo, Aug 25, 2008 23:24
Antworten mit Zitat
Benutzer-Profile anzeigen
Dein Code sagt mir, dass du dich noch mehr mit Grundlagen befassen solltest.

Code: [AUSKLAPPEN]
If xp < 0    Then xp = 1280
If xp > 1280 Then xp = 0
If yp < 0    Then yp = 1024
If yp > 1024 Then yp = 0

Hast du ne Ahnung, was dieser Code hier macht?
os: Windows 10 Home cpu: Intel Core i7 6700K 4.00Ghz gpu: NVIDIA GeForce GTX 1080
 

oki02

BeitragDi, Aug 26, 2008 10:02
Antworten mit Zitat
Benutzer-Profile anzeigen
SpionAtom hat Folgendes geschrieben:
Dein Code sagt mir, dass du dich noch mehr mit Grundlagen befassen solltest.

Code: [AUSKLAPPEN]
If xp < 0    Then xp = 1280
If xp > 1280 Then xp = 0
If yp < 0    Then yp = 1024
If yp > 1024 Then yp = 0

Hast du ne Ahnung, was dieser Code hier macht?


ja ich hatte zuerst mit einer Auflösung von 1280,1024 gearbeitet, und habe es noch nicht umprogrammiert.
 

D²O

BeitragDi, Aug 26, 2008 15:35
Antworten mit Zitat
Benutzer-Profile anzeigen
An meine Grafik angepasst.

Code: [AUSKLAPPEN]
Graphics 640,480,32,2
SetBuffer BackBuffer()

; Global's

Global xp# = 100
Global yp# = 200
Global yg# = 0

Global rechts   = 205
Global links    = 203
Global leer     = 57
Global jump_hohe = 0
Global Gravity# = 0.1
; Hauptschleife

While Not KeyHit(1)

Mensch = LoadImage("Mensch.png")

DrawImage Mensch ,xp,yp

; Tastenabfragen

If KeyDown(rechts)   Then xp = xp + 10         ; Rechts
If KeyDown(links)    Then xp = xp - 10         ; Links
If KeyHit (57) Then yg=-6

If xp < 0     Then xp = 640
If xp > 640 Then xp = 0

;If yp < 0     Then yp = 480
If yp > 475-38
       yp = 475-38
       Gravity = 0.0
       Else
       Gravity = 0.1
EndIf

yg=yg+Gravity
yp=yp+yg

Line 5,475,635,475

Flip
Cls
Wend
End
Blitz+; Blitz3d; BlitzMax; GLBasic; Purebasic;
GameMaker Studio 1.4xx; AGK;

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group