[過去ログ] 【初心者】課題をクリアしていくスレ【講習会】 (787レス)
1-

このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
290: x≠先生かつx=生徒 ⇒ x=俺 [sage] 04/07/09 00:10 ID:bufBX0Vb(1) AAS
#include "hspext.as"
screen 2, 300, 100, 4: title "Config"
pos 5, 8: mes "初速:": pos 50, 5: input speed, 215, 25: pos 270, 8: mes "m/s"
pos 5, 38: mes "角度:": pos 50, 35: input angle, 210, 25: pos 265, 38: mes "/255"
pos 5, 70: objsize 290, 25: button "Start", *start
gsel 0: stop
*start
cls
emsin sin, angle: emcos cos, angle
mx = speed * sin / 255: my = speed * cos / 255
x = 320000: y = 240000: pos x/1000, y/1000
repeat
ox = x: oy = y: x += mx: y -= my: my -= 10
if x<0: x=0: mx = -mx
if x>624000: x=624000: mx = -mx
if y>464000: y=464000: mx = mx * 8 / 10: my = -my * 8 / 10: if my<80|(mx==0): my = 0: stop
;redraw 0
color 255, 255, 255: pos ox/1000, oy/1000: mes "○"
color 0, 0, 0: pos x/1000, y/1000: mes "○"
;redraw 1
wait 1
loop
stop

改造版。

>>289
289(1): 名前は開発中のものです。 [sage] 04/07/08 23:33 ID:UCn/khb4(1) AAS
#include "hspext.as"
#const G 10
#const Coeff 10
#const Wall_e 10
#const Floor_e 8

screen 0, 640, 480, 1
dim sin,256 :dim cos,256
repeat 256 :emsin sin.cnt,cnt :emcos cos.cnt,cnt :loop

screen 2, 150, 100, 4: title "Config"
pos 5, 8: mes "初速:": pos 50, 5: input V, 50, 25: pos 100, 8: mes "m/s"
pos 5, 38: mes "角度:": pos 50, 35: input C, 50, 25: pos 100, 38: mes "°"
pos 5, 70: objsize 120, 25: button "Start", *main
gsel 0 :stop
*main
if V > 29000 : 29000
if C > 90 : C = 90
C = C * 256 / 360 :Vx = V :Vy = V :Ycnt = 0 :x = 0 :y = 0

repeat
redraw 0 :await 1
color 255,255,255 :boxf :color 255,0,0 :pos 0, 460 : mes "■" :color 0,0,255 :line 0, 475, 640, 475
color 0,0,0 :x += Vx * (-cos.C) / 256 :y += Vy * sin.C / 256 - (G * Ycnt)

if x / 1000 < 0 :Vx = -Vx * Wall_e / Coeff :x = 0
if x / 1000 > 624 :Vx = -Vx * Wall_e / Coeff :x = 624000
Ycnt++ :if y < 0 :Vy = Vy * Floor_e / Coeff :y = 0 :Ycnt = 0
pos x / 1000, -y / 1000 + 460 : mes "○" :if cnt > 0 & (Vy <= 0) :break
redraw 1 :loop :stop
投下
スゲー・・・
1-
あと 497 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.018s